Tool Security
The tool-security policy checks the serialized input request. It blocks a
local pattern, a blocked entity, or a dangerous external firewall verdict.
This policy-stage check does not prove that the gateway examined each
subsequent model-emitted tool action before dispatch.
Phase and verdicts
- Phase: input
- Verdicts:
alloworblock
Configuration
pack:
name: tool-security-example-1
version: "1.0.0"
enabled: true
policies:
chain:
- tool-security
policy:
tool-security:
analysis_mode: local
blocked_patterns:
- delete_message
blocked_entity_types:
- pan
- ssn
- jwt
Supported fields
| Field | Type | Default | Notes |
|---|---|---|---|
analysis_mode | string | local | local or external. |
firewall_endpoint | string | — | Used only when analysis_mode: external and an endpoint is configured. |
secret_key_ref | object | — | Use secret_key_ref.env for the bearer token environment variable. |
fail_closed | boolean | true | Applies to client, network, and response errors from the external firewall. |
blocked_entity_types | string[] | [] | Empty means the built-in blocked-entity defaults are used. |
blocked_patterns | string[] | [] | Case-insensitive substring matches against the serialized request JSON. |
Local checks
Local mode examines the serialized request for these constant substrings:
../..\drop tablerm -rf169.254.169.254file://curl http://localhost
It also blocks detected entities. With an empty blocked_entity_types list, the defaults are:
account_numberaws_access_keycvvhealth_plan_beneficiaryjwtmrnpanprivate_keyssn
External mode
When analysis_mode: external has a firewall_endpoint, the gateway sends these items in a POST request:
- the full request payload
- detected entities
It then interprets one or more of these as a blocking verdict:
verdictactionflagged
These values block the request: deny, block, blocked, reject, rejected, flagged, and review.
Important behavior notes
- If
analysis_mode: externalhas nofirewall_endpoint, the policy uses local checks. - Local evaluation uses substrings in the serialized request JSON. It is not a structured argument validator.
- Decision details include
flaggedandreason. Event details include matched entities when this data is available. - The policy-stage evaluator does not validate model-emitted tool arguments.
- Use a pre-dispatch tool workflow when each actual action must have authorization and argument checks.
Minimal correct example
policy:
tool-security:
analysis_mode: local