Use case · Protect

Nobody knows what our agents may do. Now one policy says.

On Team, one Protect policy covers the org, and an agent cannot loosen it. One screen shows every rule; History shows who changed each one and why. It blocks Claude Code and Codex calls through the gateway, on every machine; other agents are recorded, not blocked.

Your team

Each engineer set their own agent rules. Nobody can say what is allowed.

Built-in permissions

  • Managed settings in Claude Code
  • requirements.toml in Codex
  • One file per tool

One Protect policy

  • One policy for Claude Code and Codex
  • One log, one history
  • Agents cannot loosen it

Nothing on each laptop but a base URL.

You do not start from a blank page.

Observeno rules, blocks nothing
Balanced25 rules, 4 in Monitor
Locked down29 rules, 2 in Monitor

A switch shows a dry run first: rules added, changed and removed, and why a change loosens the policy.

Balanced starts 4 rules in Monitor. Set any other rule there first.

RunsChange cloud resources · Monitor

The call runs, and the log records "would block".

Overview shows the blocked and would-block counts for 7 days. Activity lists what no rule covers yet.

A teammate's agent tries to read .env on their laptop.

Blocked · never reaches your shellRead environment files

.env and .env.*. Examples and templates are allowed.

⛔ context-mode Protect blocked this command, so it was NOT executed:
Blocked by your team’s policy: Read environment files. .env files hold secrets.
… Tell the user it was blocked and continue with other work.

On Team, every member's Claude Code and Codex calls follow the org rules. Other agents are recorded, not blocked.

Someone wants a rule gone.

An API key can

  • Make the policy stricter

Needs a person signed in, and a reason

  • Delete a block
  • Switch a rule off
  • Turn Protect off
  • Widen the site list
API key: turn Protect off → 403
History: 40 entries, record check passed

From the latest production run. History marks every loosening change.

The problem

Every laptop has its own rules. Nobody can read them all.

One file per tool

Claude Code has permissions and managed settings. Codex has approvals and requirements.toml. Each tool keeps its own.

No one view

A security lead cannot say what any agent on the team may run, read or fetch.

A risky rollout

A new block rule can stop real work on day one, for the whole team.

How it works

Watch first. Then block, for everyone.

  1. 01Start from a preset

    Pick Balanced for the org in the console. Each laptop needs only the base URL that npx @context-mode/cli writes.

  2. 02Pick a preset, watch new rules

    In Balanced, 4 of its 25 rules start in Monitor; the rest block at once. Set any other rule to Monitor before you switch to it. A rule in Monitor lets the call run and logs "would block". The switch shows a dry run first.

  3. 03Block, and lock it

    Switch the rules you trust from Monitor to block. Agents cannot loosen them, and a script with an API key gets a 403 if it tries.

Every member's agentAsks to run cat .env on any laptop.
→
Context Mode · ProtectChecks the call against the one org policy.
  • Read environment files: blocked
  • Push to protected branches: blocked
  • Change cloud resources: Monitor
→
The modelReads the refusal as the tool result and goes on with other work.
Each agent's call goes through the gateway. Protect, in blue, applies the same rules to every member's Claude Code and Codex calls before the shell runs anything.
Proof

A key tried to turn Protect off. It got a 403.

403for an API key that tried to turn Protect off
126 of 126Protect API checks pass on production
40 entriesof history, and the record check passed in the latest run
ProtectBuilt-in permissions
CoversEvery agent and machine on the accountOne client, one machine
PolicyOne policy for Claude Code and Codex, one log, one historyManaged settings in Claude Code, requirements.toml in Codex: one file per tool
Decides byWhat a call does, even inside sudo or sh -cRules per client
Set upOne commandPer client

The org-wide case is not part of the test run. Of the 126 checks, 103 are matrix cases; the rest cover the on/off switch, presets, custom rules, history and speed. Only Claude Code and Codex calls are blocked: how enforcement works. How we tested Protect → The compare table: method and sources.

For the audit

Every change has a name. Every block has a row.

Loosening needs a person

An API key can only make the policy stricter. Deleting a block, switching a rule off or widening the site list needs a person signed in to the console, plus a reason. History marks it.

Read environment filesBlock · lockedPush to protected branchesBlock · lockedChange cloud resourcesMonitor
One log

What agents tried and which rule answered. Export as CSV or JSON Lines. No command text or file contents.

Policy as a file

Export one policy.json. Exporting twice gives the same bytes, so a git diff shows only real changes.

Products used

What this uses.

Protect

Checks every tool call before your terminal runs it. In every plan, off until you turn it on.

Presets and Monitor

Observe, Balanced and Locked down, the packs, and how a rule runs in Monitor or enforce.

Team plan

One Protect policy for the org that agents cannot loosen. One bill, at least 2 seats.

Protect docs

Every rule type, the Protect screen, History, import and export.

Related: For security teams · Keep .env secrets out · Protect main · Plans

Write the rules once. Every member's Claude Code and Codex calls follow them.

The org policy is part of Team. Write to sales@context-mode.com. To try Protect alone first, npx @context-mode/cli connects your agents: 1,000 requests free, no card.

Get started free

Your coding agent costs less and remembers your project.

Start free: 1,000 requests, every feature, no card. After you sign in, the console gives you one command to connect Claude Code or Codex.

Read the docs