ContextEvaluate a retrieval request

Evaluate a retrieval request

Evaluate a retrieval request against policy. Returns ALLOW or DENY with the matched policy name, a human-readable reason, and an event_id for lineage.

curl -X POST "https://api.autopil.ai/v1/context/evaluate" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "agent_role": "loan_underwriter",
  "user_id": "user_001",
  "source_id": "credit_scores",
  "sensitivity_level": "high",
  "session_id": "sess_abc",
  "task_type": "credit_decision",
  "agent_id": "loan-agent-prod-01"
}'
{
  "decision": "ALLOW",
  "policy_name": "loan_underwriter_policy",
  "reason": "all checks passed",
  "event_id": "evt_abc123"
}
POST
/v1/context/evaluate
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: X-API-Key)
X-API-Keystring
Required

API key with admin, read, or evaluate scope. Missing key → 401; invalid or revoked key → 403.

API key with admin, read, or evaluate scope. Missing key → 401; invalid or revoked key → 403.
Content-Typestring
Required

The media type of the request body

Options: application/json
agent_rolestring
Required

Must match a policy's agent_role exactly.

user_idstring
Required

The user on whose behalf the agent is acting.

source_idstring
Required

The data source being accessed.

sensitivity_levelstring
Required

Sensitivity of the data being retrieved.

Options: low, medium, high, critical
session_idstring
Required

Groups related retrievals. Enforces cross-agent isolation.

task_typestring

Optional. Checked against allowed_tasks / denied_tasks.

agent_idstring

Optional. Enables identity binding checks and stamps the audit event.

querystring

Optional query text; masked in the audit log when PII masking is enabled.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-API-Keystring
Required

API Key for authentication. API key with admin, read, or evaluate scope. Missing key → 401; invalid or revoked key → 403.

Body

application/json
agent_rolestring
Required

Must match a policy's agent_role exactly.

user_idstring
Required

The user on whose behalf the agent is acting.

source_idstring
Required

The data source being accessed.

sensitivity_levelstring
Required

Sensitivity of the data being retrieved.

Allowed values:lowmediumhighcritical
session_idstring
Required

Groups related retrievals. Enforces cross-agent isolation.

task_typestring

Optional. Checked against allowed_tasks / denied_tasks.

agent_idstring

Optional. Enables identity binding checks and stamps the audit event.

querystring

Optional query text; masked in the audit log when PII masking is enabled.

Responses

decisionstring
Allowed values:ALLOWDENY
policy_namestring
reasonstring
event_idstring