Policies
AgentLock policies decide whether an agent action is allowed, needs approval or is blocked: rules, overrides, rate limits and Safe Mode.
How do policies work?
A policy controls what your agents are allowed to do. Every request an agent sends is checked against the policy before anything happens.
The policy decides one of three things:
- Allow — The action runs immediately, no human involved.
- Require Approval — The action appears in your Approvals inbox. Someone must approve it before it runs.
- Block — The action is rejected. The agent gets an error.
You can create multiple policies and assign them to different agents. If an agent has no policy assigned, the workspace default policy applies.
Creating a policy — step by step
Click Create Policy on the Policies page. The modal walks you through all settings:
1. Policy Name — Give your policy a descriptive name, e.g. "Production Read-Only" or "Full Access for Deploy Bot".
2. Default Mode — This is the safety net. It decides what happens when no specific rule matches:
- Allow — Everything is permitted unless a rule says otherwise.
- Require Approval (recommended) — Everything needs approval unless a rule explicitly allows it.
- Block — Everything is blocked unless a rule explicitly allows it.
3. Override Rules — These override the default mode for specific tools or action types. See the next article for details.
4. HTTP Connector Settings — Controls for HTTP requests (domains, methods, blocklist). See the HTTP settings article.
5. Limits — Rate limiting (max actions per hour).
6. Assign Agents — Pick which agents use this policy. Agents not assigned to any policy use the workspace default.
Override rules — how do they work?
Override rules let you fine-tune the policy for specific tools or action types. Rules are evaluated top to bottom — the first match wins.
Each rule has two parts:
What does this rule match?
You pick either a specific tool or an action type:
- Tool (e.g.
browser.click,http.request,mcp.call_tool) — The rule applies only when the agent uses this exact tool. This is the most specific match. - Action type (Read / Write / Financial / Admin) — The rule applies to all actions of that type, regardless of which tool is used. This is a broader match.
- If you select a specific tool, the action type filter is hidden because the tool match already has full priority.
What should happen?
- Allow — Run immediately.
- Require Approval — Send to Approvals inbox.
- Block — Reject the action.
Example rules:
- Tool =
browser.snapshot→ Allow (just reading the page, harmless) - Tool =
browser.fill_credentials→ Require Approval (filling in a password, sensitive) - Tool =
mcp.call_tool→ Block (don't let the agent call external MCP tools) - Action type = Read → Allow (all read actions are safe)
- Action type = Admin → Block (no admin actions allowed)
Important: By default, financial and admin rules set to Allow are automatically upgraded to Require Approval — this safety rail protects you from an agent moving money or destroying infrastructure without human review. If you really need auto-approval for those categories, you can opt in via the Danger Zone section at the bottom of the policy editor. Read the warnings there carefully.
Which tools can agents use?
When creating a rule, you can select from all available tools in the dropdown:
Browser tools (Playwright-based website automation):
browser.open— Start a new browser session (always requires approval)browser.navigate— Go to a URLbrowser.click— Click an element on the pagebrowser.type— Type text into a fieldbrowser.fill_credentials— Auto-fill login credentials from the vaultbrowser.snapshot— Get a text snapshot of the page contentbrowser.screenshot— Take a screenshotbrowser.press_key— Press a keyboard keybrowser.select— Select an option in a dropdownbrowser.scroll— Scroll the page up or downbrowser.close— Close the browser session
HTTP tools (API calls):
http.request— Make an HTTP request (GET, POST, PUT, PATCH, DELETE). Agents can also send it ashttp.
SSH tools (remote command execution):
ssh.run— Execute a single command (works one-shot or against an existing session)ssh.open— Open a persistent session (always requires approval, plan-gated)ssh.close— Close a persistent session
MCP tools (Model Context Protocol):
mcp.list_tools— List available tools on an MCP servermcp.call_tool— Call a tool on an MCP server
Permission routing meta-tool:
permission.claude_code— Used by the Claude Code / Codex / Gemini / OpenCode hooks. You normally don't write rules for this directly; use the SSH/Bash command rules section of the policy instead.
You can create rules for any of these tools individually or use action type rules (Read/Write/Financial/Admin) to cover broader categories.
HTTP connector settings explained
The HTTP section controls what your agents can do with the http.request tool:
Allowed Domains — A comma-separated list of domains the agent is allowed to call (e.g. api.stripe.com, api.github.com). If this list is empty, all HTTP calls require approval as a safety measure. Subdomains are automatically included — adding stripe.com also allows api.stripe.com.
Allow requests to any domain (entire internet) — Dangerous opt-in. When enabled, the agent can call any URL on the internet; the allow list is ignored. Only the block list and HTTP method restrictions still apply. An agent with this flag can exfiltrate data to attacker-controlled servers after a prompt injection, so prefer an explicit allow list whenever possible. Use this only for trusted exploration or test workspaces.
Allowed HTTP Methods — Toggle which methods are permitted:
- Read (GET) — Fetch data
- Write (POST) — Send/create data
- Update (PUT, PATCH) — Modify existing data
- Delete (DELETE) — Remove data
Only enable what your agent actually needs. For a read-only agent, just enable Read. AgentLock runs no other methods: HEAD, OPTIONS and the rest are blocked, also when a policy saved earlier still lists HEAD or OPTIONS.
Block List — Domains that are always blocked, regardless of other rules. Use this to explicitly prevent access to sensitive internal services (e.g. internal.company.com). Block list takes priority over both the allowed domains list and the "allow any domain" flag.
Note: All HTTP requests also include built-in SSRF protection — agents cannot call private IPs, localhost, or cloud metadata endpoints.
Rate limits and how they work
The Max actions per hour setting limits how many actions a single agent can perform. Once the limit is reached, further actions are rejected with an error until the window resets.
This protects against runaway agents that might loop and send thousands of requests. The built-in default is 100 actions per hour.
Rate limiting is enforced per agent, not per workspace — so if you have 3 agents each with a limit of 100, they can collectively perform up to 300 actions per hour.
Assigning agents to a policy
At the bottom of the policy editor, you'll see a list of all your registered agents. Check the ones that should use this policy.
- Each agent can only use one policy at a time.
- Agents not assigned to any policy use the workspace default policy.
- If an agent is currently assigned to a different policy, you'll see "(other policy)" next to its name.
The default policy cannot have agents assigned — it automatically applies to all agents without a specific policy.
What is the default policy?
Every workspace has a default policy that cannot be deleted. It applies to all agents that don't have a specific policy assigned.
The built-in default policy is:
- Default mode: Require Approval
- Read actions → Allow (low risk)
- Write actions → Require Approval
- Financial actions → Require Approval
- Admin actions → Block
- Safe browser tools (snapshot, screenshot, scroll, close) → Allow
- Interactive browser tools (click, type, navigate, press_key, select, fill_credentials) → Require Approval
browser.open→ Always requires approval (hardcoded: a rule can block it, but never auto-approve it)http.request→ Require Approvalmcp.list_tools→ Allow (just listing, harmless)mcp.call_tool→ Require Approvalssh.openandssh.run→ Require Approval;ssh.close→ Allowpermission.claude_code(coding-agent hooks) → Require Approval- HTTP methods GET, POST, PUT, PATCH and DELETE allowed
- At most 100 actions per agent per hour
You can edit the default policy's rules, but not its name. The default policy is shown at the bottom of the policy list.
How does the policy engine evaluate a request?
When an agent sends a request, the policy engine checks in this order (first match wins):
- Agent status — Revoked or suspended agents are always blocked.
- Allowed tools — If the agent has a tool allowlist, the tool must be in it.
- Rate limit — If the agent exceeded its hourly limit, the request is rejected.
- Category floor (anti-downgrade) — The agent self-declares an action type (read/write/financial/admin), but the server independently classifies the request based on the tool and payload and uses the more restrictive of the two (see "What is the category floor?" below).
- Browser fast-paths —
browser.openalways requires approval: an Allow rule still needs a human, while a Block rule or a Block default mode blocks it. Otherbrowser.*actions need an open session and then go through the checks below. Inside a session an action runs only when the result is Allow; one that would need approval is refused, because an approval cannot pause a running session. - HTTP domain/method checks — Block list checked first. Then, unless "Allow any domain" is enabled, the allow list is enforced. Method restrictions always apply.
- Cost limit — If the cost estimate exceeds the policy limit → Blocked.
- Tool-specific rule — First rule naming the exact tool whose other selectors (action type, domain) match too.
- Action-type rule — First rule without a tool matching the effective action type (after the floor is applied) and, if it names one, the request's domain.
- Default mode — If nothing matched, the policy's default mode applies.
Default security rails (can be disabled in the Danger Zone):
- By default,
financialandadminactions with an "Allow" decision are automatically upgraded to "Require Approval". - Workspace admins can opt out per category via "Allow auto-approval of Financial/Admin actions" in the Danger Zone. When disabled, the explicit rule or permissive default mode is honored. Use with extreme care.
Hard override that cannot be bypassed:
- Safe Mode active → every request from every agent is blocked, regardless of action type or policy rules.
What is the category floor (and why does it matter)?
Every agent request includes a self-declared action_type — read, write, financial, or admin. Because the agent itself decides this label, a compromised or prompt-injected agent could simply label every action as read to slip past "Allow reads" rules. That's a classic downgrade attack.
To prevent it, the server computes an independent category floor from the tool name and request payload, and uses the more restrictive of the two:
effective_action_type = max(declared, floor)How the floor is computed:
- HTTP tools — GET →
read. POST, PUT, PATCH and DELETE →write; other methods are blocked. URLs containing/admin/,delete_user,drop_table, etc. →admin. URLs containingstripe,payment,charge,refund,invoice, etc. →financial. - Browser tools —
browser.snapshot,browser.screenshot,browser.scroll,browser.close→read. All otherbrowser.*tools →write. - MCP tools —
mcp.list_tools→read. Formcp.call_tool, the downstream method name is inspected for the same patterns (sostripe.create_chargevia MCP still lands infinancial); any other call iswrite. - Direct tool names — Tools containing
stripe.,payment,billing,charge,refund,transfer, etc. →financial. Tools containingadmin.,delete_user,rotate_key,drop_table, etc. →admin. - SSH tools —
ssh.openandssh.run→admin.ssh.close→write. - Unknown tools — Floored to
write, so an unrecognised tool declared asreadstill goes to approval under the default policy. The floor is a safety net for obvious downgrades, not a replacement for well-chosen tool allowlists.
What you see in the audit log: when a downgrade attempt is detected, the approval request's reason includes [category floored: agent declared 'read', server classified as 'financial'], and the audit event records both action_type (effective) and declared_action_type. This makes downgrade attempts visible to humans reviewing the log.
Consequence: even if an agent labels stripe.charge as read, the effective category is financial, so the financial action-type rule (or Default: Require Approval) kicks in and the request is held for human approval.
Can I turn off the category floor for a trusted agent?
Yes — each agent has a per-agent toggle on its detail page (header area, "Category floor (anti-downgrade)" card). Only Owners and Admins can flip it.
Default: ON — the server re-classifies every request and uses the more restrictive of the declared and derived action type. This is the safe default and what you want for almost every agent.
When you might turn it off: if you've locked an agent down with a narrow allowed_tools list and tight policy rules, the floor can feel like extra bookkeeping. An example would be a reporting agent that only calls read-only HTTP APIs — the floor never upgrades anything, it's just overhead.
What changes when you turn it off:
- AgentLock trusts the agent's self-declared action type as-is and skips the re-classification.
- A compromised or prompt-injected agent could now declare a financial action (like
stripe.charge) as a read and the read rule (usually Allow) would apply. - Every other safety mechanism still runs: the allowed-tools list, HTTP domain allowlist, Safe Mode, rate limits, explicit tool-specific Block rules, and the Danger Zone auto-approval guards. The floor is one layer among several.
- Every toggle is recorded in the audit log together with the actor and the prior value.
Rule of thumb: leave it on unless you have a specific reason to trust an agent's self-declaration. If in doubt, keep it on — the performance cost is negligible and it catches exactly the kind of bug or prompt-injection attack that's easiest to miss in a code review.
What is Safe Mode?
Safe Mode is the reversible emergency stop. When enabled:
- Every action from every agent in the workspace is immediately blocked — reads, writes, financial, admin, everything.
- Policy rules, rate limits, and Danger Zone opt-ins are all ignored. Nothing gets through.
- Agents see a Blocked response until Safe Mode is turned off again.
Use Safe Mode if you detect unexpected agent behavior and need to stop all activity immediately while you investigate. Only Owners and Admins can toggle Safe Mode.
Safe Mode vs Kill Switch: Safe Mode is non-destructive — switch it off and everything resumes. The Kill Switch (in Settings) goes further: it suspends every agent and permanently revokes all their API tokens, and engaging it requires a fresh two-factor check. Use Safe Mode to pause and investigate; use the Kill Switch when you believe an agent or its credentials are compromised.