# Security model: the layers, and where they stop Kiro Crew runs an AI agent with real shell and filesystem access on your own machine. That is the point of it, and it is also the risk: the model reads web pages, repository files, chat history and imported documents, and any of that text can try to steer the agent the way a person telling it what to do would. The two outcomes worth defending against are the agent being talked into **leaking a credential** and into **destroying something** on the host. No single control stops that. Kiro Crew stacks several, each covering a different part of the gap. This page explains the layers, what each one actually protects against, and — the part most security pages skip — **where they stop**. Read it before you decide what is safe to run Kiro Crew against: a corporate laptop full of live credentials is a different trust decision from a throwaway container, and the honest answer depends on the limits below, not just the protections. Two ideas run through everything here: - **The model is untrusted input, not a trusted caller.** Anything the model chooses — a command string, a file path, a tool title — could be coming from injected text. So the controls key on ground truth (the real command, the real resolved path), never on text the model wrote to describe what it is doing. - **You are trusted; the agent is not.** You can widen your own settings. The agent must not be able to widen them for you, which is why the files that hold your security settings are ones the agent cannot **write** — and the ones that carry a live credential it cannot read either (see [the trust root](#the-trust-root-the-agent-cannot-rewrite-its-own-limits)). ## The layers Each layer below covers a different path, and they fail in unrelated ways. Which of them stand between the agent and a given credential depends on your settings; see [Where the layers stop](#where-the-layers-stop). | Layer | What it does | What it protects against | |---|---|---| | Interactive approval | Asks you before a tool call runs (opt-in; the default `auto` approves automatically) | A surprising or destructive action you did not intend | | Denied-command rules | Refuses known-dangerous command shapes at Kiro Crew's own gate | Credential exfiltration, destructive and self-protection commands | | Filesystem gate | Refuses file-tool reads and writes of credential and settings paths | A tool reading `~/.aws` or rewriting your config | | Input validation | Checks every Kiro Crew tool call against a schema | Malformed or oversized tool input, hidden-character tricks | | Output redaction | Owner switch, off by default: masks credentials in what other people or apps can see | A secret reaching a channel, a teammate, a shared link or an app | | OS sandbox | Confines the agent subprocess with OS-level isolation | A shell reading a credential file the tool gate does not see | | Audit log | Records security decisions in a tamper-evident log | Not knowing, after the fact, what happened | Alongside these sit the request authentication for the dashboard (see [Dashboard](dashboard.md)), the Slack owner lock (see [Slack integration](slack-integration.md)), the app trust model (see [Apps](apps.md)), and — on a managed or enterprise host — a governance ceiling that your settings cannot loosen, described [further down](#governance-the-enterprise-ceiling). One structural point matters more than any single layer: **the denied-command and governance checks are Kiro Crew's own, not the agent's.** They run in the gateway, so an agent configuration that omits or edits its own rule list cannot weaken *them* — a hard deny and an enterprise ceiling hold whatever the agent config says. This is specifically the deny and governance tier. It is not a claim that every tool a backend exposes is mediated the same way: the native tool permissions of an ACP backend (for example the `permissions.deny` rules the Claude backend seeds from the agent spec) come from configuration the way any backend's do, so treat Kiro Crew's own gate as the floor, not as a wrapper around every capability the chosen harness has. ### Interactive approval Kiro Crew can pause before a tool call and ask you to approve it. Be clear about the **default**, because it is the opposite of what a security-minded reader expects: `agent.approval_mode` ships as `auto`, which **auto-approves** tool calls rather than prompting. Set `agent.approval_mode="interactive"` to make a tool call that is not already trusted pause and ask you first. The setting is read once when Kiro Crew starts, so a change takes effect at the next restart. A Bot's chat and its workers follow the Bot's own **Permissions** mode instead, and a Bot with none set opens in Trust, which approves every call. In interactive mode you can approve a call once, trust that exact command, trust a command pattern, trust read-only commands, or trust everything for the session. An MCP tool's card can also always allow that one tool: that grant is saved to your config, applies in every chat, and stays until you remove it in **Settings → Security**. A separate ad-hoc "auto-approve" (YOLO) escalation turns prompting off in every chat for the `agent.yolo_duration` window (6 hours by default, or until you stop Kiro Crew). It is kept across a restart, an update, a crash or a reboot, and so are a chat's trust-everything and trust-read-only modes; only a stop you choose (`kirocrew stop`, Quit in the desktop app, or Ctrl+C on a gateway in your terminal) ends them early. A declared auto-approve (`kirocrew gateway --approval yolo`, `agent.dangerously_skip_permissions`) is armed again at every start. Apart from YOLO and the per-tool grant, trust is scoped to the chat that granted it, and it is derived from the **actual command**, not the title the model gave it. Approval — or its absence — never routes a deny through on its own. The deny and governance checks run first, so neither a trust decision, a YOLO grant nor the `auto` default can pass a blocked action. The one way past a denied-command rule is your own click on its override card, described next. ### Denied-command rules Some command shapes are refused at the gate whatever the approval mode: reading credential files into an outbound request, destructive infrastructure and data operations, publishing to a protected branch, and the agent trying to disable Kiro Crew or mint its own dashboard token. You can see the full list, disable individual rules, disable them all, and add your own patterns, in **Settings → Security**. **You can waive most of these rules yourself, one call or one chat at a time.** When a denied-command rule refuses a shell command in a dashboard chat you are driving on the Kiro CLI, KAS or Claude harness, and `agent.deny_override` is on (the default), the chat shows a card with **Allow once**, **Allow for this session** and **Deny**. An allow runs the gate again with only that one rule waived, so any other rule the command breaks still refuses it, and each waiver is written to the audit log (the call is refused if that write fails). "Allow for this session" keeps the waiver in memory for that chat only; it ends with the chat or a gateway restart and never changes your saved rule settings. Only the owner's own click on the dashboard answers the card: a trust rule, a YOLO grant and the `auto` default never do, and a chat started by an app, a cron job or a messaging channel gets no card; neither does a chat on any other harness. Some refusals are never offered for a waiver: the self-protection and credential-exfiltration rules, a push whose target the protected-branch check cannot read, the command-nesting depth cap, any rule a governance policy pins, and any rule your edition's security overlay adds. This tier has a real and deliberate limit worth stating once here: it reads the command line a tool call carries, so a program the line only *names* (a script file, a runtime-assembled string, an `eval` of a variable) is never opened and a command hidden inside it is not matched. Read it as defense in depth, not the control of record — for anything irreversible, that is the layer below (which credentials the session can reach and what the sandbox lets a process do). [Blocked commands and credential access](blocked-commands.md) covers why that limit is deliberate, what each refusal tells the agent to do instead, and how to check your own credential setup. ### Filesystem gate Kiro Crew's file tools refuse to read or write a set of sensitive paths: credential directories (`~/.aws`, `~/.ssh`, `~/.gnupg`, `~/.netrc`, `~/.npmrc`, `~/.git-credentials`, `~/.config/gcloud`, `~/.azure`, `~/.docker/config.json`, `~/.kube/config` and their kin), the secret vault, and Kiro Crew's own settings files. The check runs on the fully symlink-resolved path, so a link pointing into a blocked directory is refused through the link, and it runs before the file operation, so every file-read and file-edit tool is covered regardless of how it opens the file. The limit to keep in mind: the filesystem gate governs Kiro Crew's **file tools**. A path read by a raw shell command — a `cat`, a `python -c "open(...)"` — is **not** matched here; the command gate does not path-match shell text either, so a shell read of a credential directory is the OS sandbox's job, not this layer's (see below). That division is exactly why both layers exist. ### The trust root: the agent cannot rewrite its own limits The files that hold your security settings fall into two dispositions, and the difference is the honest part. The channel credential `.env` and the secret vault carry live secrets, so the sandbox **hides** them — the agent can neither read nor write them. The governance policy and profiles, the denied-command state, and the runtime config are instead **read-only**: the agent can read them but cannot write them. They are left readable on purpose — hiding a ceiling file would make it resolve to the *permissive default*, which is the opposite of what you want — and read-only is enough, because the risk is an agent rewriting its own ceiling (setting `disable_all` to switch off the deny gate on the next restart), not reading it. The result, **wherever the Kiro Crew sandbox is active**, is that your settings and an enterprise ceiling are **un-disableable from inside the agent**. That write seal is a Kiro Crew sandbox rule, not an OS file permission, so the legitimate writers — the dashboard, the channel handlers, `kirocrew config` from your own terminal — run outside the sandbox and are unaffected. The flip side is the caveat: the seal is only as present as the sandbox. Under `agent.sandbox: "off"`, and on a path that runs unconfined (Windows with no backend), the file is writable by a shell again — so an enterprise host that depends on this un-disableability pins the sandbox on through the governance `sandbox.min_level` floor rather than leaving it to config. One residual belongs here rather than in the reassuring version: the audit log's signing key is **not** fenced this way (see [Where the layers stop](#where-the-layers-stop)). ### Input validation Every tool call to a Kiro Crew tool is checked against a declared schema before the handler runs: unicode is normalized and hidden control and formatting characters are stripped (so a credential cannot be smuggled through an invisible character), fields are range- and pattern-checked, unknown fields are rejected, lengths are capped, and tool output is truncated at a ceiling so it cannot become a denial-of-service vector. ### Output redaction Credential redaction is one owner switch, **Settings → Security → Redaction**, and it is **off by default**. An administrator's policy can keep it on; where a policy governs, it stays on unless that policy allows turning it off. With the switch off, credentials appear as written in what only you see: your own dashboard session, your Files view, your 1:1 DM with the crew bot (where Kiro Crew can tell it is one), and the conversation replayed into the model's prompt. What anyone else can see stays redacted whatever the switch says: a channel or group with other members, a Shared Crew teammate, an allowlist link or an app. With the switch on, redaction applies to your own views too. It masks only values that grant access, including the credential value inside a URL, and it recognizes credential families in plaintext and in base64. It also matches a credential with invisible characters inside it, such as a zero-width space or a soft hyphen. Redaction is not the request-blocking checks. The credential checks on commands and URLs run with the switch on or off. A URL the checks flag is a rendering decision: the dashboard shows a Blocked link card, whatever the switch says. Redaction's boundary is the human and the wire. It does **not** scrub what the agent reads during a turn: a command or file result reaches the model as read, and with the switch on only the earlier conversation replayed into the prompt is masked. So it is not what keeps a secret the agent read out of the model. ### OS sandbox The sandbox confines the agent's subprocess tree with OS-level isolation — a user and mount namespace on Linux, Seatbelt on macOS — hiding credential directories and scrubbing credential-bearing environment variables before the process starts. It is the enforcement point for the case the command gate deliberately does not cover: a plain shell reading a file. `agent.sandbox` has three values. The per-tier directory lists — exactly which paths each tier hides — live in one place, [Configuration → Sandbox](configuration.md); this page describes what the choice *means* rather than repeating the table: - **`auto`** (the default) runs the sandbox at its **standard** tier. Standard hides a set of credential and Kiro Crew directories, but it deliberately leaves `~/.aws`, `~/.ssh`, `~/.kube` and `~/.config/gh`, plus the credential files `~/.npmrc`, `~/.pypirc`, `~/.netrc` and `~/.git-credentials`, **visible**, because the `aws` CLI, boto3, `credential_process`, git-over-SSH, `gh`, `kubectl`, npm/pip registry auth, `.netrc` HTTPS auth and the git credential store all need them, and an agent that cannot reach them cannot debug or deploy for you. **Be clear-eyed about the consequence: under the default, a shell command such as `cat ~/.aws/credentials` or `cat ~/.git-credentials` succeeds, and so does a shell read of a GitHub CLI login.** The file tools still refuse every one of those paths but `~/.config/gh` (in `~/.kube`, its `config` file), and the credential-shaped commands are still denied, but a direct shell read of them is not fenced at this tier. - **`strict`** additionally masks every path in that list (`~/.ssh` keeps only `known_hosts` readable), at the cost of those same tools inside the agent. Set it when the host holds credentials the agent must never read and you accept that trade. - **`off`** skips the Kiro Crew sandbox. The default is a deliberate trade, not an oversight: tightening it for everyone on an upgrade would silently break the credential tooling most people rely on. The tier is yours to tighten, and this page names what the default leaves open so the choice is informed. Two further properties: - **A missing sandbox is a refusal, not a silent downgrade.** If a mode other than `off` is set and no sandbox backend is available, Kiro Crew refuses to spawn rather than running the agent unconfined — unless you opt in explicitly, or you are on a platform (Windows) where no backend can ever satisfy the check and the default is to allow with the cost stated. - **Isolation is sometimes delegated to kiro-cli's own sandbox.** On Windows there is no Kiro Crew OS sandbox: only a positively-identified official Kiro CLI spawn on its v2 engine delegates to the CLI's own built-in sandbox (with its environment scrubbed first). Every other subprocess — including **KAS, the default chat harness**, and MCP servers, hooks and script cron jobs — runs **unconfined** under the Windows default, because an undeclared `agent.sandbox_allow_unsandboxed_exec` resolves to allow there. Picking the **Kiro CLI** harness does not avoid this once your kiro-cli offers its v3 engine: that choice then runs on the KAS path, whose KAS process kiro-cli does not confine on Windows. Those processes can read your home directory, `.aws` and `.ssh` included; only the environment scrub and the audit record still apply. They take the refusal above only once you declare `agent.sandbox_allow_unsandboxed_exec=false`, which refuses a KAS chat (including a Kiro CLI choice running on KAS) rather than confining it, and `agent.sandbox="strict"` changes nothing on Windows. The [Windows install guide](https://github.com/kirodotdev/KiroCrew/blob/main/docs/guides/windows-install.md#kiro-sandbox-delegation-and-the-unsandboxed-exec-opt-in) covers this posture in full. On macOS, a spawn is delegated the same way when kiro-cli's internal sandbox is enabled, because the two seatbelt sandboxes cannot nest. On any delegated path — Windows or macOS — Kiro Crew's own credential-directory masks do **not** apply; the delegated sandbox's confinement is what holds. The [limits](#where-the-layers-stop) section returns to this. ### Audit log Security decisions — a denial, an auto-approve grant, a sandbox delegation, a sensitive internal read — are written to an append-only, HMAC-chained Security Event Log, so tampering between the recorder and an external reader is detectable rather than merely discouraged. The owner can read recent events and verify the chain over the API. Several of these writes are fail-closed: an auto-approve grant, a deny exception and a sandbox delegation refuse to proceed if their audit record cannot be written. The honest limit here is twofold. The events are queryable over the API, but there is **no dashboard to browse, filter or alert on them**, so review and anomaly-spotting are manual today. And the HMAC chain detects tampering only by *another* party: the signing key itself is readable and writable by a sandboxed shell (see [Where the layers stop](#where-the-layers-stop)), so a sufficiently capable agent could rewrite the log and re-sign it. The chain is evidence against outside tampering, not proof the agent that produced the events did not alter them. ## Governance: the enterprise ceiling On a managed or enterprise host, a second control sits above your own settings: a governance policy, loaded at startup from the trust root, that your configuration can only make **tighter**, never looser. It is enforced at the same gate as everything else, so a policy can deny a tool or command even when the agent's own configuration granted it, and — because the policy files are read-only to sandboxed code — the agent cannot rewrite the ceiling it runs under (it can read it, which is deliberate: a hidden ceiling file would resolve to the permissive default). On such a host the policy can **pin** denied-command rules so you cannot disable them, not even with "disable all" — which rules are pinned is set by the policy's `commands` scope, and composes with your settings on a tightest-wins basis (the categories an enterprise typically pins are listed in [Blocked commands](blocked-commands.md)). `kirocrew policy show` and `kirocrew policy explain` print the ceiling in force. **Governance reaches computer use through one on/off key only.** Driving native desktop applications is an opt-in you grant on a protected file, enforced on its own dispatch path rather than the command gate; it is off by default. That opt-in is ANDed with the `capabilities.computer_use` policy key: a policy that turns the key off keeps desktop control off whatever the opt-in says, and an enterprise build keeps it off until a policy turns the key on. Nothing finer — which apps, which actions, approval — is governed. See [Computer use](computer-use.md) for what it can and cannot reach. ## Where the layers stop Every item here is a real residual. None is a bug to be reported — each is a trade Kiro Crew made on purpose, named so you can weigh it. These are the facts that should drive the host-versus-container decision at the end. - **The default sandbox tier leaves cloud, SSH, Kubernetes, GitHub CLI and package-registry credentials readable by a shell.** As above: under `auto`, a shell read of `~/.aws`, `~/.ssh`, `~/.kube`, `~/.config/gh`, `~/.npmrc`, `~/.pypirc`, `~/.netrc` or `~/.git-credentials` succeeds. If that is unacceptable for your host, use `strict`. - **There is no network egress control by default.** The sandbox hides credential files; it does not restrict where the agent can send data. A compromised agent can post non-credential data to an arbitrary host. The request-blocking credential checks and the credential-exfiltration rules blunt the credential case. Where a governance policy is configured, the `network.egress` scope bounds the destinations of Kiro Crew's own network tools — web fetch, web search, and the host an MCP tool call carries in its arguments; a shell or subprocess (`curl`, a script) is governed only by `commands` patterns, which do not bound where the traffic goes. There is no default-on network boundary: a network namespace or host firewall allowlist would close it. - **The agent shares the host.** The OS sandbox hides specific directories and scrubs specific environment variables; it is not a container or a virtual machine. The agent subprocess runs under your user account and shares the host's process namespace, so it is isolated *from certain paths*, not sealed off from the machine. Anything that runs as your user — including the agent — can reach what your user can reach that the sandbox did not specifically hide. - **The audit log's own signing key is reachable from a shell.** The HMAC key that signs the Security Event Log is left readable and writable by a sandboxed process in every mode — a knowingly-carried residual, because the in-sandbox components that append to the log need the key to do it. So the chain detects tampering by an outside party, but an agent capable enough to rewrite the log and re-sign it could cover its own tracks. Closing this means moving those in-sandbox log writers behind the gateway, not tightening a mask. - **Your shell startup files are not write-protected.** Credential directories and Kiro Crew's own trust root are blocked, but ordinary files like `~/.bashrc` or `~/.zshrc` are not — blocking the whole home directory would make the agent useless for real work. A write there is a genuine persistence vector, held back only by the approval gate and the destructive-command rules. - **The command gate is not a shell parser.** It normalizes aggressively and closes the well-known evasions, but a payload assembled at runtime leaves nothing for a pattern to match. See the denied-commands note above; the un-disableable guarantees rest on the hidden and read-only trust root, not on these patterns. - **On Windows, the default chat harness runs with no OS confinement.** Under the Windows default, KAS and every subprocess that is not a Kiro CLI spawn — MCP servers, hooks, script cron jobs — run unconfined and can read `%USERPROFILE%\.aws` and `.ssh` from a shell. A Kiro CLI harness choice delegates to kiro-cli's sandbox only while it stays on the v2 engine; once kiro-cli offers v3 it runs on KAS and is unconfined too. `strict` adds nothing there. Declaring `agent.sandbox_allow_unsandboxed_exec=false` refuses the unconfined spawns instead. - **On Windows, Codex, OpenCode and Copilot CLI run behind a credential mask, not a sandbox.** They run at Low integrity: they cannot read the credential files Kiro Crew masks (`.aws`, `.ssh`, `.netrc`, Kiro Crew's own secrets) and can write only their project, state, scratch and temp folders. The rest of your user folder stays readable, the network stays open, and Windows Credential Manager is not covered. The [Windows install guide](https://github.com/kirodotdev/KiroCrew/blob/main/docs/guides/windows-install.md#codex-opencode-and-copilot-cli-the-harness-mask) lists the limits. - **A denied-command rule can be waived by its owner.** Where the override card is offered, it lets you allow one refused call, or that rule for the rest of a chat, with your own dashboard click. The refusals listed above as never offered keep their refusal, and no automatic approval answers the card, but every other rule is only as firm as the person clicking. - **On Windows and on macOS's delegated path, Kiro Crew's own credential masks do not apply.** When isolation is delegated to kiro-cli's built-in sandbox, Kiro Crew's extra directory masks are not the ones in force; the delegated sandbox's own confinement is. On those paths a credential *directory* is covered only by the file-tool gate (for the agent's file tools; it does not cover `~/.config/gh`) and by the delegated sandbox itself — not by the command gate, which does not path-match shell text — and redaction, while the switch is on, still scrubs any credential that reaches a view it covers. - **Resource ceilings depend on the platform.** Linux uses cgroup limits for per-subtree process and memory caps where available; Windows uses Job Object limits; macOS and Linux hosts without that support have no hard per-subtree ceiling, only a file-descriptor cap and post-failure cleanup. - **Confinement is not verified from inside the agent.** Kiro Crew decides fail-closed whether a backend exists before spawning, but nothing checks from within the agent process that the confinement actually took effect. A sandbox that loads but does not enforce would not be noticed. ## Choosing a posture for your host Putting the layers and their limits together: - **A throwaway container or an isolated personal machine.** The defaults are a reasonable fit. The host holds little worth stealing, so the default sandbox leaving `~/.aws` and the other credential stores shell-readable costs little, and the absence of an egress boundary matters less. The `auto` approval default (which approves tool calls without asking) is more comfortable here than anywhere else. - **A corporate or shared machine with live credentials.** Treat the defaults as a starting point to tighten, not a finish line. On Linux and macOS, set `agent.sandbox="strict"` so a shell cannot read the credential directories (on macOS a spawn delegated to kiro-cli's own sandbox is confined by that sandbox instead). On Windows, `strict` does nothing, and picking the Kiro CLI harness no longer confines chat once kiro-cli offers its v3 engine; your options there are declaring `agent.sandbox_allow_unsandboxed_exec=false` so unconfined spawns, KAS chat included, are refused, or running Kiro Crew in a VM (see the [Windows install guide](https://github.com/kirodotdev/KiroCrew/blob/main/docs/guides/windows-install.md#kiro-sandbox-delegation-and-the-unsandboxed-exec-opt-in)). Everywhere, set `agent.approval_mode="interactive"` so tool calls prompt you instead of auto-approving (restart Kiro Crew for it to take effect), and set each Bot's **Permissions** to Normal, since a Bot with none set opens in Trust; and if outbound data is a concern, put the agent behind a network namespace or host firewall, because Kiro Crew ships no egress boundary for shell or subprocess traffic. On a managed host, the governance ceiling is what makes these non-optional for the agent — see your administrator. - **Either way, the agent is not sandboxed from the whole machine.** If a task genuinely must not be able to touch the host, run Kiro Crew in a container or a VM. The in-product layers raise the cost of the common injection paths; they are not a substitute for OS- or hypervisor-level isolation when the blast radius has to be zero. ## Related - [Blocked commands and credential access](blocked-commands.md) — the denied-command tier in depth, and how to check your own credential setup. - [Configuration](configuration.md) — the `agent.sandbox` modes and the full config reference. - [Secrets vault](secrets-vault.md) — storing credentials where the agent cannot read them at all. - [Computer use](computer-use.md) — the capability governance reaches only through the single `capabilities.computer_use` key, and what it refuses.