
AI agents do more than suggest code. They run shell commands, read files, call services, change infrastructure, and interact with production systems.
Kontext puts local policy between AI agents and the tools they call. It observes supported actions, evaluates policy before consequential actions run, and records the decision and outcome in an authorization ledger.
Start in observe mode. See what policy would stop. Move supported boundaries into enforcement when you are ready.
Policy evaluation errors allow the tool call, including in enforce mode, and remain visible as failures in the activity record. Completed policy denies and unavailable required approvals still block. This error fallback does not change behavior when the daemon is unavailable or enforcement has no usable policy.
Kontext currently supports Claude Code, Claude Cowork, and Codex. Exact event and enforcement coverage varies by agent—see the agent support matrix.
Managed Claude hooks recognize Cowork sessions with either full or shortened session directory names, preserving their Cowork identity in activity records.
brew install kontext-security/tap/kontext
Create an install token in the Kontext dashboard, then run:
Setup:
Verify the installation:
Then keep using Claude Code or Codex normally. You do not need to launch the agent through a separate wrapper.
Self-serve setup currently supports macOS. Managed and cloud environments can run the same local runtime when they provide a supported hook contract, storage, and daemon lifecycle.
Without pre-action policy, an agent action executes before a security team can review its logs:
agent requests an action
|
v
action executes
|
v
activity appears in a log
With Kontext:
agent requests an action
|
v
Kontext receives it through a supported hook
|
v
local policy evaluates the action
|
+---- allow ----------> action continues
|
+---- would deny -----> action continues and evidence is recorded
| (observe mode)
|
+---- deny -----------> action is stopped before execution
(enforce mode)
|
v
decision and outcome enter the authorization ledger
This creates a decision point before the action, not only a record after it.
Blocking every unfamiliar action on day one creates noise and interrupts developers. Allowing every action indefinitely leaves policy as passive monitoring.
Kontext separates rollout into two modes:
Observe mode records the policy decision without interrupting the agent.
Use it to answer:
Enforce mode returns a real denial when a deterministic policy matches at a supported synchronous pre-action hook.
Policies can define boundaries around actions such as:
Enforcement is intentionally limited to event surfaces where the agent waits for Kontext before continuing. Kontext does not claim that receiving an event means it can stop every action from that agent.
Every supported event that reaches Kontext can contribute evidence to the local authorization ledger.
A record can include:
Kontext records tool activity and decision evidence. It does not capture model reasoning or reconstruct full conversation history.
Managed deployments can export redacted records to the Kontext dashboard for organization-wide review, retention, and investigation.
The decision path stays local:
Claude Code / Cowork / Codex
|
v
supported hook
|
v
local Kontext runtime
|
+-----+------+
| |
v v
policy decision local ledger
|
v
allow / would deny / deny
A hosted service does not need to answer every tool call.
Managed deployments add organization configuration, policy rollout, record export, identity, and retention. They do not move the synchronous decision path out of the agent environment.
“Supported” means more than accepting an event. Kontext documents which events it receives, which events can block, and how each integration is installed.
| Agent | What Kontext records | Pre-action blocking | Installation |
|---|---|---|---|
| Claude Code | Session lifecycle, pre-tool-use, successful and failed post-tool-use | Pre-tool-use | Installed by kontext setup |
| Codex | Session start, pre-tool-use, post-tool-use, prompt submission, stop | Pre-tool-use | Installed by kontext setup; hooks must be trusted in Codex |
| Claude Cowork | Claude Code-compatible session and tool events | Pre-tool-use | Configure the hook inside the Cowork environment |
See the agent support matrix for exact behavior, deployment scope, and known gaps. It is the authoritative source for enforcement coverage.
A process sandbox asks:
Which files, network destinations, credentials, and operating-system resources can this process access?
Kontext asks:
Which agent is attempting which action, what policy applies, should the action proceed, and what evidence proves the decision?
Kernel sandboxes are strong containment boundaries. Kontext provides semantic policy and attribution at supported agent and tool hooks.
They are complementary:
Kontext
decides whether the action is authorized
|
v
sandbox
constrains what the process can physically access
Kontext does not claim kernel-level isolation. Use an appropriate sandbox when the threat model requires process, filesystem, or network containment.
Logs tell you what an agent reported after an event.
Kontext creates an authorization decision before supported consequential actions execute, then links that decision to the available outcome.
That distinction matters during:
The result is not only “the agent called a tool.” It is evidence of what was requested, which policy applied, whether it was allowed, and what happened next.
Managed deployments add:
For deployment planning and organization onboarding, contact [email protected] or book a conversation.
doctor checks:
It exits non-zero when a configured installation is unhealthy.
When a self-serve daemon is stale:
Rotate the installation token by running setup again:
Remove the self-serve installation:
kontext setup --uninstall
See the Guard documentation for the runtime and data boundary.
go build -o bin/kontext ./cmd/kontext
go test ./...
go test -race ./...
go vet ./...
kontext report shows discovered agents and authority exactly as last accepted
by the cloud. Use kontext report --json for the raw payload. Before the first
successful send, it reports no data.
Set KONTEXT_AUTHORITY_SCAN=off in the daemon environment to disable authority
collection and transmission on this Mac.