api.orcarouter.ai, and you want every
tool call that key makes to be governed — blocked, audited, sanitized, or
held for approval — without touching your agent code. That’s a two-step
agent firewall setup: create a firewall policy
once, then point the key at it. From the next call on, every tool the key
issues is checked against the policy at the gateway.
This page is the create-and-attach path. For the full policy model
(surfaces, verdicts, resolution) see the Firewall
overview; for the rule grammar see
Firewall Rules.
All policy and key configuration happens in the console (or the
/api/workspace/firewall/* management routes, which use your session /
access token — not a relay sk-orca-… key). Only your agent’s /v1/*
calls use the relay key. Creating and attaching a policy is a
Developer+ action.1. Agent firewall setup at a glance
A firewall policy is a named, workspace-scoped object: an ordered list of rules plus a default verdict for everything no rule matches. A key opts in to a policy through itsfirewall_policy_id field. Nothing else in
your stack changes.
Create the policy
Name it, pick a default verdict, add rules — or seed from an
autonomy level / preset and edit.
Attach a key
Set the key’s
firewall_policy_id to the policy, or mark the policy
as the workspace default so every unattached key inherits it.2. Create a policy in the console
- Open Security → Firewall → Policies and choose New policy.
- Name it (workspace-unique) and leave Enabled on.
- Pick a default verdict — see §3.
- Add rules in the rule editor, or start empty and let Discovered tools drive authoring from real traffic later.
- Save. The policy exists but governs nothing until a key points at it or you make it the workspace default.
3. Pick the default verdict
The default verdict is what the policy does when no rule matches a tool call. It is the floor of your posture. It accepts exactly three values:default_verdict | When no rule matches… |
|---|---|
audit (default) | Allow the call, but record it. Observe everything, block nothing — the safe place to start. |
allow | Allow and log, no review record. |
deny | Block anything a rule doesn’t explicitly permit — a default-deny posture you pair with allow rules. |
allow, audit, deny, sanitize,
pending_approval, cap_cost) are covered in
Verdicts — the default verdict is limited to
the three above.
4. Attach the policy to a key
A key opts into a policy through itsfirewall_policy_id. In the
console:
- Open Keys, edit the key your agent uses.
- Set Firewall policy to the policy you created (this writes
firewall_policy_id). - Save. The next call that key makes is governed.
Authorization: Bearer sk-orca-… and the same request body. There
is no change to your agent’s tool-calling code.
inbound surface, that call comes back
as HTTP 400 with code firewall_blocked, naming the tool and reason —
see what a block looks like.
5. Resolution: attached → workspace default
For any tool call, the gateway resolves which policy applies in this order:1. The key's attached policy
1. The key's attached policy
If the calling key’s
firewall_policy_id points at a policy that
exists and is enabled, that policy applies.2. The workspace default
2. The workspace default
Otherwise, the workspace’s enabled
is_default policy applies (if one
is set). At most one policy per workspace can be the default; promoting
a new default demotes the old one in the same transaction.3. Neither → no enforcement
3. Neither → no enforcement
No attachment and no default means no policy. With
observe mode on the call is allowed and
logged as a coverage gap; with it off the call is allowed silently.
A disabled attached policy falls back to the workspace default — it
does not turn enforcement off. (This differs from
guardrails, where a disabled
attachment resolves to none.) To take a key out of firewall scope,
detach it (set
firewall_policy_id to 0), don’t just disable its policy.6. Verify it took effect
Before relying on it, confirm the policy fires the way you expect:- Test it — the sandbox Test tab dry-runs the policy against a sample tool call and returns the verdict, the matched rule, and the reason. Nothing is dispatched or persisted. See Test rules.
- Watch the events feed — once the key takes live traffic, Events shows each evaluation, filterable by verdict, surface, tool, and run.
Where to go next
Authoring rules
The full matching language — tool globs, argument clauses, egress
lists, sanitizers.
Tool allow-listing
Pair a
deny default verdict with explicit allow rules.Manage policies
Defaults, enable/disable, versioning, and revert.
Why zero trust
Why governing actions — not just text — matters for agents.
