# Secrets and API keys in Kiro: keep credentials out of the agent's reach

Source: https://botpassword.com/agents/kiro
Last checked: 2026-10-25

Kiro is AWS's agentic IDE and CLI. MCP servers are configured in `.kiro/settings/mcp.json` (workspace) or `~/.kiro/settings/mcp.json` (user), as local `command` servers or remote HTTPS `url` servers. Kiro expands only approved `${VAR}` references, and reads steering files from `.kiro/steering/` and `AGENTS.md`.

## MCP support

Yes. Transports: stdio, http.

- workspace: `.kiro/settings/mcp.json`
- user: `~/.kiro/settings/mcp.json`

## Environment variables and .env files

Use `${VARIABLE_NAME}` in `env` or `headers`. Kiro only expands variables that are explicitly approved; a config using unapproved variables shows a warning, and you approve them under "Mcp Approved Env Vars" in IDE settings. Remote URLs must be HTTPS (HTTP for localhost). Workspace and user files merge, with workspace settings taking precedence. The pages reviewed do not describe `.env` loading.

## File access

Steering file references follow the session's file-read permissions and ignore rules, which Kiro documents on separate Permissions and Kiroignore pages that could not be reviewed. In the MCP file, `autoApprove` lists tools that run without prompting (`"*"` approves all) and `disabledTools` hides tools from the agent.

## Credential risks

- **CVE-2026-10591 (Kiro IDE before 0.11).** Per Amazon security bulletin 2026-037-AWS as reported by third parties, injected instructions could make the agent write to an editor control file so that VS Code tasks ran when the workspace opened. Fixed in 0.11.
- **Prompt-injection data leak via steering and Powers.** Mindgard reported that attacker-controlled repository content, including steering files and Kiro Powers that bundle MCP configuration, could steer the agent into sending local data to an external endpoint; an earlier steering-file variant was fixed in 0.8.140.
- **`autoApprove: "*"` removes tool prompts.** Kiro's MCP documentation warns to review tools before adding them to `autoApprove` and to use `disabledTools` to restrict dangerous operations.

## FAQ

### Where is Kiro's MCP configuration file?

`.kiro/settings/mcp.json` in the workspace and `~/.kiro/settings/mcp.json` for all workspaces. If both exist they are merged and workspace settings win.

### How do I use an environment variable in Kiro's mcp.json?

Write `${VARIABLE_NAME}` in `env` or `headers`, then approve the variable in IDE settings under "Mcp Approved Env Vars"; Kiro does not expand unapproved ones.

### Does Kiro read AGENTS.md?

Yes. Kiro reads steering directives from `AGENTS.md` in the workspace root, in subdirectories, or in `~/.kiro/steering/`, and always loads them.

### How do I give Kiro an API key without it seeing the key?

Don't put the key in the prompt, in a file Kiro can read, or in an environment variable it can print. Give it a tool that performs the authenticated step instead: a credential broker exposed over MCP or a CLI that injects the key into the command or HTTP request and returns only the result. BotPassword is that broker, through `bpw mcp` and the `bpw` CLI.

## Sources

- https://kiro.dev/docs/mcp/configuration/
- https://kiro.dev/docs/steering/
- https://thehackernews.com/2026/08/amazon-kiro-prompt-injection-can.html
- https://vibegraveyard.ai/story/kiro-prompt-injection-vscode-task-rce/
