Evaluate API
Your application uses the evaluate endpoint to actually use a rule at runtime - this is separate from the Preview card, which only tests a rule while you’re building it.
Authentication
Section titled “Authentication”The evaluate endpoint accepts a Bearer API-key token, so any external application can call it - no dashboard login needed.
Request fields
Section titled “Request fields”Required:
entity_type- one ofcontext,prompt, orevaluation.fields- a flat key-value map of the current input values to check against your rules’ conditions (e.g.{"model": "gpt-4", "user_tier": "premium"}). Up to 50 fields.
Optional:
include_entity_data- set totrueto get full entity records back in the response, not just IDs.entity_inputs- extra, per-entity-type options. For example, when retrieving aprompt, you can passvariablesandshouldCompileto get the prompt back with its{{variableName}}placeholders filled in.
Only rules with Status = Active are ever evaluated - Inactive rules are skipped entirely.
Response shape
Section titled “Response shape”matchingRuleIds- the IDs of the rules that matched.entities- references to each matched rule’s linked entities.entity_data- present only ifinclude_entity_datawas set, keyed by"{entity_type}:{entity_id}"with the full record. Full entity data is currently only populated forcontextandpromptentity types, not forevaluation.
Create an API key
Section titled “Create an API key”- Navigate to Settings → API Keys in Shield360.
- Click Create API Key, enter a name, and save the key securely.
Call the evaluate endpoint
Section titled “Call the evaluate endpoint”Send a POST to /api/rule-engine/evaluate. The full code examples and request/response schema live in two places, depending on what you need: