§ DOCUMENTATION
Runtime Guardrails
Per-agent tool-invocation policies, tool-output PII and injection scanning, and agent-to-agent credential authentication — enforcement that runs at call time, not just at policy definition time.
The two runtime policy types
Execlave adds two new policy types that gate agent execution at runtime rather than at trace ingestion. Both are created via POST /api/v1/policies with the corresponding policyType value.
| policyType | What it guards | When it runs |
|---|---|---|
| tool_invocation | Which tools an agent may call — allow/deny by tool name | Before the tool executes |
| tool_output_scan | The output a tool returns — scanned for PII and prompt injection | After the tool returns, before the agent sees it |
Both types require the FF_RUNTIME_GUARDRAILS feature flag to be set in your backend environment. The flag defaults to off — existing behavior is fully preserved when it is absent.
tool_invocation — allow/deny tool calls
A tool_invocation policy is a per-agent allow/deny list over which MCP tools the agent may call at runtime. Execlave evaluates the policy before the tool executes — if the tool is on the deny list or absent from the allow list (depending on your default action), the call is blocked and an audit event is recorded. No tool execution occurs.
curl -X POST https://api.execlave.com/api/v1/policies \ -H "Authorization: Bearer $EXECLAVE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Restrict data-exfil tools for research-agent", "policyType": "tool_invocation", "enforcementMode": "hard_block", "ruleDefinition": { "agentId": "agt_01j...", "allow": ["web_search", "read_file"], "deny": ["send_email", "upload_file", "execute_code"] } }'The ruleDefinition accepts an allow array, a deny array, and an optional agentId to scope the policy to a specific agent. Tools on the deny list are blocked unconditionally. Tools not listed on either array inherit the policy's default action.
tool_output_scan — PII & injection screening
A tool_output_scan policy intercepts the value a tool returns before it flows back to the agent. Execlave delegates scanning to the processing service — the same detectors used by Injection Detection and PII Detection, via the /scan/pii and /scan/injection endpoints.
When PII is detected and pii_action is set to redact, the sensitive spans are replaced before the output reaches the agent. When injection is detected with enforcementMode: "hard_block", the output is suppressed entirely and a block audit event is recorded.
Scanning is latency-bounded. If the processing service is unavailable, Execlave logs a warning and passes the output through rather than halting the agent — a processing outage does not hard-block workloads.
curl -X POST https://api.execlave.com/api/v1/policies \ -H "Authorization: Bearer $EXECLAVE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Scan DB-query output for PII before agent sees it", "policyType": "tool_output_scan", "enforcementMode": "hard_block", "ruleDefinition": { "scan_pii": true, "scan_injection": true, "pii_action": "redact" } }'A2A credential authentication
When one agent calls another, Execlave can require the calling agent to present its verifiable credential before the downstream agent proceeds. This is controlled by the FF_A2A_AUTH feature flag (default off).
The credential used is the exe_agt_ credential issued via Agent Identity. On POST /api/v1/agents/authorize, Execlave verifies the caller's agent credential and records an a2a.authorize audit decision — granting or denying the inter-agent call with a full evidence trail.
A2A auth is additive: the calling agent still requires a valid API key or JWT for general API access. The exe_agt_ credential adds verifiable agent identity on top of that baseline.
Enabling runtime guardrails
Both runtime guardrail capabilities are gated by backend environment flags. Set them in your backend .env or deployment configuration. When a flag is absent or set to false, the corresponding feature is inactive and prior behavior is preserved exactly.
| Environment variable | Effect when true |
|---|---|
| FF_RUNTIME_GUARDRAILS | Activates tool_invocation and tool_output_scan policy types |
| FF_A2A_AUTH | Activates A2A credential verification on /api/v1/agents/authorize |
The two flags are independent — you can enable tool-invocation and output-scanning without enabling A2A auth, and vice versa.