Nyraxis/ docs
Providers
Developer documentation

Prompt injection

Configuration, evaluation scope, and practical limits for prompt_injection.

prompt_injection is the policy type used by the API and policy editor.

What it checks

Checks submitted input for attempts to override instructions or obtain protected system information.

Configure the policy

Create a policy under Dashboard → Security → Policies. Choose this policy type, set the agent scope, and start in warning mode while you measure results. Use blocking only after verifying the application’s decision gate.

The following is the config object, not a complete policy-creation request:

{
  "threshold": 0.8,
  "detection_mode": "thorough"
}

Scope and limits

detection_mode: "fast" selects a narrower check. This is separate from the evaluation API’s mode field. Thorough mode requires the additional checks to be available and uses a bounded text prefix. Findings and scores are signals, not proof that all injection attacks are covered. Retrieved text must be explicitly submitted at its own trust boundary.

Verify before rollout

Test a representative safe input, a synthetic positive case, and an unavailable-detector case. Inspect evaluation_status, errors, policies_evaluated, findings and allowed. A clean empty finding list is useful only when the required checks completed.

The policy mode determines the decision: warning findings can coexist with allowed: true. Your application must act on a blocking decision before the protected operation. Evaluation does not automatically redact text or cancel an operation that already happened.

On this page