Create a Firewall Policy
Create a prompt-injection policy — and make block reachable for an agent.
POST
Create a prompt-firewall policy
Creates a policy.
action is what makes this endpoint matter:
With no policy attached to an agent, the outcome is
warn and block is
unreachable. Creating a policy with action: "block" and setting the agent’s
firewall_policy_id is what turns detection into refusal.
Every regex rule is compiled through a safe-regex validator at write time, so a
pattern that could backtrack catastrophically is refused here rather than
discovered on the hot path. Dry-run a rule set first with
Test firewall rules — the
tester compiles through the same validator, so a pattern it accepts can actually
run.
Requires the create capability on ai_gateway. See the control-plane overview for authentication, the {data, meta} envelope, pagination and error types.Authorizations
OAuth 2.1 authentication — recommended for new integrations. Access tokens
(kc_ prefix) are minted at the root-host token endpoint
https://api.knoxcall.com/oauth/token and passed as Authorization: Bearer <access_token>.
Public clients must use PKCE with the authorization_code grant; confidential
clients may use client_credentials. The first-party SDKs and the
knoxcall login CLI handle token minting, caching, refresh, and DPoP for you.
Body
application/json