Castle account-takeover protection
Community-contributed integration
This integration is community-maintained. Reference: ory/integrates/fraud-bot-protection/castle.
Castle is an account-takeover and fraud-prevention platform with device fingerprinting, behavioral analytics, and risk scoring per user and event.
How it works
Castle uses a send-events and read-risk model:
Pre-flow risk check (sync, can interrupt the flow):
- Ory Action on
login.before/registration.beforewithcan_interrupt: truecalls the handler with identity + IP + device context. - Handler POSTs to Castle's
/v1/riskendpoint with the event type and identity payload. - Castle returns an
action(allow,challenge,deny) and ariskscore. - On
deny, handler returns an error and Ory blocks the flow.
Post-flow event reporting (async, signal collection):
- Ory Action on
login.after/registration.after(async,response.ignore: true) calls the handler. - Handler POSTs
$login.succeeded/$registrationevents to Castle's/v1/trackendpoint. - Castle updates its model for future risk scoring.
Both flows must run for Castle to be useful.
Notable
- Castle requires a stable user_id keyed on the Ory identity id (not email) for identity-graph continuity.
- Risk thresholds are tunable per event type — start permissive, tighten as you collect data.
