@huatek/ghostkey-risk-engine
v0.1.8
Published
Configurable contextual risk engine for GhostKey Auth.
Readme
@huatek/ghostkey-risk-engine
Configurable contextual risk engine for GhostKey Auth.
Use this package to score login attempts and sensitive actions using device trust, known networks, recent failures, geolocation signals and action context.
Install
npm install @huatek/ghostkey-risk-engineUsage
import { createRiskEngine } from "@huatek/ghostkey-risk-engine";
const riskEngine = createRiskEngine({
maxRecentAttempts: 5,
blockScore: 85,
approvalScore: 65
});Then pass it to GhostKeyAuth:
const auth = new GhostKeyAuth({
// ...
riskEngine
});Default behavior
- Known device and known network: allow.
- Known device and new network: allow with alert.
- New device and known network: require approval.
- New device and new network: block or require recovery.
- Many recent attempts: temporary block.
- Unusual location: elevated risk.
- Sensitive action: fresh verification.
Notes
- Risk output is a decision signal, not identity proof.
- Device fingerprint should only be a risk input.
- For high-risk actions, combine policies with step-up auth.
