Docs / Safety / Security Guard

Security Guard

An ask-only safety net for secrets, downloaded scripts and untrusted instructions.

Written for v2.1.0 · updated 2026-11-20

The Security Guard is an extra layer that watches for the things an AI agent should not do quietly: sending your secrets off the computer, running a script someone else wrote, harvesting credentials, or acting on instructions hidden in a web page or an email. It is a safety net, not a boundary: it asks you first; it never decides for you.

What it is, and what it is not

What it checks

CatNameAsks about
SSecrets leaving this computerA network, publish or upload action whose payload holds a secret file, a secret value, secret environment variables, or an archive of sensitive files: curl, wget, Invoke-RestMethod, scp, rsync, rclone, aws s3, az storage, gsutil, gh gist or release, git push, docker build or push, npm publish, twine, cargo, deploy tools, WebFetch with a token in the URL, a mail or chat MCP tool sending a secret, browser file upload of a credential file, putting a secret on the clipboard, copying a secret to a network share
YSecrets in a cloud-synced folderWriting or copying a secret into OneDrive, Dropbox, Google Drive, iCloud, Box, Nextcloud, an Obsidian vault, the TiroAgents vault or ~/.claude/** (a sync job pushes it)
IIgnore rules overriddengit add -f or git add -A that would stage a secret, editing .gitignore/.dockerignore/.npmignore so a secret is no longer ignored, --no-verify, core.hooksPath, copying a secret under a harmless name, archiving a tree that holds secrets
CCredential stores and environmentBrowser profiles (logins, cookies), Keychain, Credential Manager, secret-tool, pass, LSASS or SAM dumps, ~/.aws, ~/.ssh private keys outside the project, dumping all environment variables
HBulk harvestingRecursive searches for passwords or key files over your home folder or a drive, and reading very many files or folders outside the project in a short time
XScreen, clipboard and input captureScreenshots, reading the clipboard, keystroke capture, remote-debugging ports
UUnwanted script or persistence`curlbash, iwriex, encoded PowerShell (the decoded text is scanned too), carets or backticks hiding a command, running a file from Downloads or Temp, scheduled tasks, startup entries, cron, launchd, systemd, shell profiles, git hooks, edits to ~/.claude/settings.json, installs from a URL, npx of an unknown package, starting claude` from a shell
PUntrusted instructions in tool outputAfter a fetched page, search result, file or mail contained text aimed at the AI (see below), the next action that sends, runs, spawns or writes outside the project

Each category can be set to ask (default), log (note it in the audit log, do not interrupt) or off.

Secrets are found by name and by content

A file counts as a secret by its name (.env, .env.*, *.pem, id_rsa*, .npmrc, .pypirc, .netrc, .git-credentials, .aws/, .azure/, gcloud, .kube/, *.tfstate, *.tfvars, *.pfx, *.p12, *.kdbx, .docker/config.json, and more) or, for a renamed file, by its content (key formats, NAME=value secrets, high-entropy tokens). Templates such as .env.example pass when their content holds only placeholders. The first 256 KB of a file named in an S, Y or I operation is scanned; values are never shown or logged, only NAME=•••• (len N).

ignore files are not trusted

.gitignore, .npmignore, .vercelignore and similar files, and any text that says "X is ignored", change nothing: the Guard works out what would really be sent (the files a git push would send, the npm pack list, the deploy folder, the source of an rsync). The one exception is .dockerignore, because Docker itself honours it; it is applied with Docker's own matching rules. When the payload cannot be listed exactly (for example a path with a variable the Guard cannot expand), the card says estimated.

Untrusted instructions (P)

After a tool result (a fetched page, a search, a file, a mail or document from an MCP tool, the output of curl or gh issue view) is scored for text aimed at the AI ("ignore previous instructions", fake system tags, hidden characters, instructions to send secrets, markdown images that would leak data), a high score taints the session for 60 minutes. A banner appears, the model is told the text is untrusted data, and the next action that sends data, runs a script, spawns an agent or writes outside the project asks first. Allowing the asked action, or typing a new message yourself, ends the warning. A page that merely mentions the word "deny" does not trigger it.

Prompts you will newly see

Ordinary work does not trigger the Guard: git push asks only if what would be pushed holds a secret, npm install of a normal package is silent, curl to localhost is silent, and a plain download is only logged. You will see a Security Guard ask, in the same card as other permission requests, showing the category, the matched rule ids with a plain sentence, the command with secrets masked, the files and why each matched, the destination, and whether the payload is exact or estimated:

Your choices: Yes (once), No, No, and tell Claude what to do instead, and, only where it is safe, Yes, and remember this exact action (24 hours for C, H and X; for U as long as the script's hash is unchanged). S, Y, I and P are never remembered. A remembered action is exact: a different command, file, content or destination asks again, and nothing is remembered in a session that read untrusted instructions.

Settings, and why an agent cannot switch the Guard off

Settings live in kiro.json under guard: { S, Y, I, C, H, X, U, P: 'ask' | 'log' | 'off', syncRoots: [], trustedNpx: [], trustedHosts: [], hooksInTerminals: true }. Open them in the dashboard (Breaker box, Security Guard) or the island (Settings).

A stricter change applies at once. A weaker change (ask to log or off, a trusted host or package, terminals off) takes effect only after a confirmation dialog that only the desktop app can open. The app then saves the confirmed settings in guard/confirmed.json with an HMAC keyed by a secret that is encrypted with the operating system (Electron safeStorage). A weaker value written into kiro.json by anything else (an agent, a script, a hand edit) is ignored: the last confirmed value stays, the change is noted in the audit log, and the dashboard shows "Guard setting changed outside the app; kept ...". A terminal started outside the app cannot verify the HMAC and uses the strictest settings. There is no HTTP route that changes the Guard settings.

Audit log

guard/audit.jsonl (private to you, rotated at 5 MB, three files, entries older than 90 days dropped) records time, session, agent, tool, category, rule ids, decision (ask or log), your answer, destination host, paths (home shown as ~), a short file hash, exact or estimated, and the command with secrets masked, cut to 300 characters. It never records file contents, environment values, clipboard or screenshots. View it in the dashboard (Breaker box, Audit log).

Limits you should know