Security at Context Mode

Your developers' coding agents run shell commands, read files and send code to a model. Context Mode is the gateway on that path. It blocks a destructive command before it runs, keeps each account's data in that account's own stores, and gives Standard a 99.9% monthly uptime SLA. Each fact on this page comes from the gateway's code.

Key facts

Command control
Protect checks each shell command, file read, web fetch and tool-server call from Claude Code and Codex before it runs. A blocked call does not reach the shell.
Data isolation
Each account has its own stores on Cloudflare. A request reaches the stores of its own account and no other.
Retention
Recall archive: 7 days on Free, 30 days on a paid plan. Usage rows: 90 days. You set how long Protect events stay, from 1 to 365 days. Imported session history has no end date.
Encryption at rest
Cloudflare encrypts all stored data with AES-256 in Durable Objects, R2 and Workers KV.
Training
The gateway has no training or fine-tuning step. Cloudflare does not use content processed by Workers AI to train AI models.
Keys
The gateway stores your device key as a SHA-256 hash, never the key. It reads the key's record on each request.
Uptime
Standard has a 99.9% monthly uptime SLA with service credits.
Erase
On request. This page lists each store the erase route clears.
Contact
security@contextmode.ai

Protect: a control on what your agents run

An agent can run git push --force, terraform destroy or rm -rf ~ during a task. Protect reads each tool call on the gateway before your terminal runs it. In Claude Code and Codex, a blocked call does not reach the shell, and the model reads why.

Protect reads the call before it runs. Keep your agent's sandbox on as the second layer.

Data flow

Your coding agent sends each request to the Context Mode gateway. The gateway folds tool output, adds memory, checks tool calls against your Protect rules, and sends the request on to the model provider. The answer comes back the same way.

01
Agent
Setup points your agent at the gateway: ANTHROPIC_BASE_URL for Claude Code, a context-mode model provider for Codex. Each request carries your device key.
02
Gateway
Runs on Cloudflare Workers. It reads your Protect rules, counts the request, and keeps the memory and the archive of your sessions in your own stores.
03
Model
The gateway forwards to api.anthropic.com, api.openai.com or chatgpt.com. The credential your agent sends picks the host: an Anthropic key goes to Anthropic. Your own provider account pays the model.

The gateway's own model work (what to remember, recall ranking, search vectors) runs on Cloudflare Workers AI, on the same platform as the gateway. Cloudflare does not use content processed by Workers AI to train AI models, and it processes that content only for as long as the request needs (Workers AI data usage). The gateway has no training or fine-tuning step. It forwards your requests to Anthropic or OpenAI as your own calls, and your terms with that provider apply to them.

You stay in control of the path: npx @context-mode/cli disconnect takes the gateway out, and your agents then talk to Anthropic and OpenAI directly.

Encryption in transit, encryption at rest, and keys

What the gateway stores, where, and for how long

Each account has its own stores. Your memory store, your session store and your request counter are each a separate Cloudflare Durable Object, named by your account. Larger bodies go to Cloudflare R2 under your account's own prefix. Device keys are read from Cloudflare Workers KV.

Region. Your stores are created in Cloudflare's Eastern Europe region, close to the gateway in Frankfurt.

DataWhereHow long
Recall archive, prompts and episodesYour memory store (Durable Object). A prompt over 24 KB keeps its text in R2.7 days on Free, 30 days on a paid plan. A daily run deletes older rows.
Memory facts, skills and settingsYour memory store (Durable Object)Until you delete them or we erase your account
Usage rows and insight eventsYour memory store (Durable Object)90 days
Per-request savings rows and session totalsYour memory store (Durable Object)Until we erase your account
Diagnostic records of oversize requestsYour memory store (Durable Object)7 days
Sessions and transcriptsYour session store (Durable Object). Imported history moves to R2.The last 200 live turns per project and worktree; older turns become short summaries. Imported history has no end date: no timed run deletes it.
Protect rules and their change logYour session store (Durable Object). The change log is append-only and hash-chained.Until you change them or we erase your account
Protect events (each allow or block)Your session store (Durable Object). Decision fields only, never the command text.Protect events: 30 days by default. You can set 1 to 365 days.
Device keys and sign-out markersThe account registry. Device keys are SHA-256 hashes. The gateway reads them from Workers KV.Until we erase your account

Each memory fact goes through a secret redactor before the gateway stores it. Archived tool output is read back with secrets and e-mail addresses masked.

Who can read it, and how access is controlled

Subprocessors

CompanyWhat for
CloudflareThe gateway (Workers), every store (Durable Objects, R2, KV), the gateway's own model work (Workers AI) and account email
StripePayments, invoices and the billing portal
ResendEmail to your account address
Anthropic, OpenAIThe model providers your agent calls, on your own account
Google, GitHubSign-in only: your name and e-mail address

Uptime: a 99.9% SLA on Standard

Standard has a 99.9% monthly uptime SLA for the gateway request path. When a month is below that level, your team gets a service credit on that month's fee.

Monthly uptimeService credit
Below 99.9%10% of that month's fee
Below 99.0%25% of that month's fee
Below 95.0%50% of that month's fee

The team admin claims the credit by email within 30 days. Live status and history are at status.contextmode.ai.

How the gateway behaves under failure

Erase on request

Write to us and we run the owner-only erase route, /__admin-erase-tenant, for your account. It needs the admin key, and the request must repeat the account id to confirm. A dry run counts the rows and deletes nothing. In order, the route erases:

  1. your memory store: memory, recall, prompts and the knowledge base, then every other table, including usage and savings rows;
  2. your session store: sessions, workspaces and transcripts;
  3. every topic store of your account;
  4. your registry rows: device keys, credential bindings, CLI events, the email log and checkouts.

The account row stays without your address: the address becomes a SHA-256 hash, the account is turned off, and the address is taken off all mail.

Report a vulnerability

Security contact: security@contextmode.ai. Write to security@contextmode.ai with the steps to reproduce and what you saw. Test only against your own account and data.

Compliance documents, questionnaire and DPA

Compliance documents and the security questionnaire: on request, through Talk to us. DPA: on request, through Talk to us. Talk to us.

Context Mode is operated by MKSF LTD, London, United Kingdom.

Choose Context Mode when …

  • Your developers' agents run commands on machines that reach production, and you want one policy that every agent follows before a command runs.
  • You must show an auditor what the agents tried and which rule answered, with no command text in the record.
  • You want each developer's memory and sessions in that developer's own stores, with a known retention time for each kind of data.
  • You need an uptime level in writing: 99.9% a month on Standard, with service credits.

Standard is one plan for the whole team: one request pool, team Protect rules and the 99.9% SLA. The price is on Pricing.

Get started free

Context Mode Gateway: your coding agent costs less and remembers your project. Context Mode Engine installs from your terminal.

Start free: 10,000 requests, every feature, no card. After you sign in, the console gives you one command to connect your coding agent.

Read the docs