Repository navigation
Integrations Gemini Sandbox
Experimental: Tracekit's Gemini CLI hooks are experimental (support). Tested:
TK-A004andtracekit doctoragainst arguments and settings as Gemini CLI's source defines them; not yet against the hook payload of a real permission expansion (#312).
Gemini CLI has two sandboxes, both off by default:
-
The tool sandbox (
security.toolSandboxing) runs each shell command inside an operating-system sandbox: bubblewrap and seccomp on Linux, Seatbelt on macOS, a restricted token on Windows. A command can write the workspace and has no network unless it's granted more (below). Gemini CLI itself, and the hooks it runs, stay outside. -
The whole-CLI sandbox (
tools.sandbox,GEMINI_SANDBOXor-s) re-runs all of Gemini CLI, its hooks included, inside a container (Docker, Podman, gVisor, LXC) or under Seatbelt on macOS.
Use the tool sandbox with Tracekit; the whole-CLI one doesn't work with it (below). The two do different jobs and work together:
| Gemini CLI's tool sandbox | Tracekit | |
|---|---|---|
| What it does | Limits what a shell command can write and reach while it runs | Decides each call before it runs, holds risky ones for a person, and signs a record of every call and approval |
| Where | Inside Gemini CLI, around each command | A signer outside the agent (dev or system mode) |
| What a third party can check later | Nothing signed; Gemini keeps its own session files | A signed, hash-chained bundle, verified offline |
Turn both on. Tracekit first (tracekit init --dev --v2 --agent gemini, coding agents), then
the tool sandbox in ~/.gemini/settings.json, next to the hooks init wrote, and restart Gemini CLI:
{
"security": {
"toolSandboxing": true
}
}Leave tools.sandbox unset, and don't set GEMINI_SANDBOX or pass -s. tracekit doctor reads Gemini's settings
files when they hold Tracekit's hooks (D-GEMINI-SANDBOX, doctor): it warns when they turn on the
whole-CLI sandbox, and reports the tool sandbox when it's on. It can't see GEMINI_SANDBOX or -s given at launch,
which override tools.sandbox.
The whole-CLI sandbox runs Tracekit's hooks inside it, or not at all:
-
In a container, the hooks
tracekit initwrites to~/.gemini/settings.jsonaren't there: Docker, Podman and gVisor get a copy of that file without itshooks, and LXC mounts the workspace, not~/.gemini. No Tracekit hook runs, so the session isn't recorded, and no gap marks it: the signer never hears of the run. Project hooks (--project) would run inside the container, which has neither Tracekit nor its signer. - Under Seatbelt, the hooks run inside Gemini's profile, which lets a process write only the workspace, temporary and cache directories. Tracekit's hook can't keep its state there, so it blocks every call.
With the tool sandbox on, Gemini's shell tool takes an additional_permissions argument: network: true, or paths
under fileSystem.read and fileSystem.write. Gemini tells the model to use it when a command failed with "Operation
not permitted", and the command then runs with that network access and those paths. Whether Gemini asks you first
(a Sandbox Expansion Request) depends on its approval mode and policy rules; in YOLO mode it approves every call.
Gemini's BeforeTool hook sends the call's arguments, additional_permissions included, before Gemini's own policy
and prompt. The coding pack's TK-A004 (an ask rule) holds every call whose additional_permissions turns the
network on or names a path, until a person approves it from outside the agent's session, and signs the decision.
The call waits; from another terminal:
tracekit approvals list # pending approvals
tracekit approvals show apr-… # the command and the permissions it asks for
tracekit approvals approve apr-…
The approval is bound to the exact arguments, the requested permissions included, used once, and recorded with who
approved it, like every Tracekit approval (approvals). The signed decision names TK-A004, so a
bundle shows which calls asked for more than the sandbox allows and who approved each. Gemini's own approval step
still follows. To allow expansions without asking, override TK-A004 in your own policy (policy).
-
Sees: every call Gemini sends to its hooks, with its arguments (
additional_permissionsincluded), the decision, any approval, and the result. Records commit to the arguments rather than store them (privacy). -
Doesn't see: permissions Gemini grants outside a call's arguments: what its approval mode allows, an expansion
Gemini proposes itself for a command it knows needs more (such as
npm install), and one you allowed for good, which later runs of that command get without asking. What the sandbox blocked shows only in the command's output. -
Doesn't record: Gemini's sandbox settings. They aren't signed into the run;
tracekit doctorreads them on the machine. -
Doesn't check:
GEMINI_SANDBOXor-sat launch, or whether Gemini trusts the folder (it ignores an untrusted project's settings).D-GEMINI-SANDBOXmerges the files it reads key by key (doctor).
Limits lists these with what to do.
Generated from docs/ at v1.4.1. Edit the docs in the repository, not here.
Get started
- Quickstart: the v2 signer
- Quickstarts
- Quickstart: Claude Agent SDK
- Quickstart: a custom agent
- Quickstart: LangChain and LangGraph
- Quickstart: MCP client
- Quickstart: OpenAI Agents SDK
- Coding agents other than Claude Code
- tracekit doctor
- Walkthrough: Tracekit end to end
How it works
- How Tracekit works
- Overview
- The life of a tool call
- The evidence format
- Verification and assurance
- Witnesses and monitoring
- Policy
- Approvals
- Detection and containment
- Capture and completeness
- Custody
- Provenance and tracekit why
- Deployment and isolation
- Storage, durability and performance
- Integrations
- Security model
- Architecture
- tracekit why: architecture
Integrations
- Integrations
- Adapters
- OpenTelemetry
- Remote clients
- Kubernetes agent-sandbox
- agentgateway
- agentsh and Tracekit
- Browser Use
- Claude Agent SDK
- Claude Code's sandbox
- Codex's sandbox
- CrewAI
- Docker MCP Gateway
- E2B
- Falco
- Gemini CLI's sandbox
- Google ADK
- Haystack
- LangChain v1
- LiteLLM
- LlamaIndex
- MCP client
- microsandbox
- Microsoft Agent Framework
- OpenAI Agents SDK
- NVIDIA OpenShell
- Pydantic AI
- sandbox-runtime's proxy on its own
- Strands Agents
- Tetragon
- Vercel AI SDK
- Wassette
Policy and approvals
- Policy reference
- Approvals
- Findings
- Reading the model's reasoning
- Incidents and containment
- Webhooks
Deploy and operate
- Deploying the signer
- The signer as a container
- The signer on Kubernetes
- The compose stack
- Identity
- Tool executor
- MCP gateway
- LLM gateway
- Egress observation
- Witnesses
- Log monitor
- Record-key issuer
- Signer observability
- Viewer
- tracekit why: causal investigation and replay
- Migrating
- Platforms
Verify the evidence
- Reading a v2 verify report
- Evidence format v2
- Auditor guide
- Sample evidence bundle
- Signing
- What Tracekit guarantees
Security and privacy
- Threat model: the v2 signer
- Threat model: the v1 laptop signer
- HTTP security checklist
- Threat-model review packet
- Privacy
- Known limits and trade-offs
- What's stable
Compliance
- Compliance mapping
- EU AI Act
- ISO/IEC 42001
- NIST AI RMF and the Generative AI Profile
- OWASP Top 10 lists for LLM and agentic applications
Evaluation
Demos
- Demos
- Agent approvers within bounds
- Completeness and tamper evidence
- Detection and containment
- Network coverage: an egress observer
- Guardrails: allow, deny, or ask a person
- MCP tools, gated and recorded
- Prompt injection held by provenance
- Why: which input caused the action
Help