Skip to main content
Kiro is an agentic IDE from AWS. Its agent can read repositories, write files, run shell commands, and call external tools on the developer’s machine. TrustGuard agent hooks evaluate local prompts and actions.

NeuralTrust controls

Install TrustGuard from the trustguard-kiro-plugin repository, from a checkout or through MDM. Kiro hooks are defined per workspace, so the hook files go into each project you want protected. Configure TrustGate separately in Kiro’s mcp.json.

Deployment options

Use separate credentials for TrustGuard and TrustGate. The hooks use a tgk_… collector key in kiro.json. MCP authenticates as an application with OAuth or an ag_… API key. A tgk_… key does not authenticate MCP, and kiro.json does not accept MCP settings.

Before you start

Create the policy in Observe mode. Observe records decisions in Activity without enforcing them. Review the results, then switch the policy to Enforce. See Policies. Developers do not need NeuralTrust accounts for the hooks path.

Set up prompt and tool screening (TrustGuard)

Install from a checkout (pilot)

make setup-key writes ~/.trustguard/kiro.json (chmod 600) and sends one harmless test prompt to /v1/evaluate. It asks for four values: make install-local WORKSPACE=…:
  • Copies the hook runtime (trustguard-hook.sh, trustguard_hook.py) to ~/.trustguard/kiro/
  • Writes trustguard-prompt-submit.json, trustguard-pre-tool.json, and trustguard-post-tool.json into <workspace>/.kiro/hooks/, with an absolute path to the runtime. Kiro runs hook commands with the workspace as cwd, so relative paths are unreliable
Then open the project in Kiro, trust the workspace when prompted, and run Developer: Reload Window. The three hooks appear in the Agent Hooks panel. Repeat make install-local WORKSPACE=… for every project you want protected; the runtime is shared. Without make, run scripts/setup-key.sh and scripts/install.sh /path/to/project.

Deploy under MDM (enterprise)

An MDM deployment consists of three components: Managed key config.
When the managed file includes api_key, its data_url, api_key, and fail_mode cannot be overridden by the user file or environment variables. See Configuration.

Set up governed tool access (TrustGate)

Kiro treats TrustGate as a remote MCP server: one url per MCP application, and the agent sees the merged toolkit that application is routed to. Copy the endpoint from the application’s Connect tab:
Add it to .kiro/settings/mcp.json (workspace) or ~/.kiro/settings/mcp.json (user). From the command palette, Kiro: Open workspace MCP config (JSON) and Kiro: Open user MCP config (JSON) open the two files. When both exist, Kiro merges them and the workspace file takes precedence. OAuth applications (recommended). Only url is required:
Kiro runs the browser-based OAuth flow on first connect, registering a client against the discovery documents TrustGate publishes. Nothing has to be registered per developer. API-key applications. Send the application key as a header, and keep it out of the file with a ${…} environment reference:
Private (Hybrid) data plane. Add "X-AG-Gateway-Slug": "<gateway-slug>" to headers unless the MCP host already scopes the gateway. TrustGate tool calls pass through the TrustGuard hooks like any other MCP call.

Verify

Hooks.
  1. In Kiro, open the Agent Hooks panel and confirm trustguard-prompt-submit, trustguard-pre-tool, and trustguard-post-tool are listed.
  2. Ask the agent to run a shell command.
  3. Confirm the event in TrustGuard Activity.
Smoke-test the runtime (optional):
Exit 0 means allowed; exit 2 means denied, with the reason on stderr. MCP.
  1. Open the MCP servers view in the Kiro panel and confirm TrustGate is connected.
  2. Ask the agent to use a tool from a toolkit bound to that application.
  3. Confirm the call in TrustGate Activity.

Reference

Coverage

TrustGuard can evaluate Kiro prompts, commands, file writes, and tool calls from a local checkout during a pilot or from an MDM deployment. Session taint. A blocked prompt or a blocked tool result taints the Kiro chat. Every later tool call in that chat is denied locally, without calling the API, until the developer starts a new chat. Taint markers live in ~/.trustguard/logs/kiro/taint/. Prompts. Kiro ignores the exit code of UserPromptSubmit hooks today (kirodotdev/Kiro#11050), so a blocked prompt still reaches the model. The plugin enforces the block through session taint: no tool can run in that chat afterwards. Ask. The result of an ask verdict depends on the event: Masking. On a DLP transform verdict for a tool call, transform_action decides the outcome: mask (default) runs the tool with the masked input, ask shows the masked input for approval, and deny blocks. If TrustGuard returns no masked payload, the call is denied. A prompt cannot be rewritten; the agent is told not to repeat the sensitive value. On a tool result, a transform is logged, or taints the session when transform_action is deny. Limits. Hooks run only in a trusted workspace and only for workspaces with the hook files installed. Commands the developer types in Kiro’s terminal do not go through hooks; only agent actions are covered. A PostToolUse block cannot erase output the tool already produced. The plugin tells the agent to treat the result as untrusted, not to follow instructions in it or repeat sensitive values, and taints the session. The hooks do not evaluate model responses or tool declarations. Use TrustGate to control which tools are available.

What is evaluated

Every hook calls POST /v1/evaluate with the collector tgk_… key, and the policy’s detectors decide the verdict. Kiro names MCP tools mcp_<server>_<tool>. When the server is listed in the workspace or user mcp.json, the plugin strips the server prefix, so params.name is the <tool> segment; otherwise the full name is sent. Gate on the short tool name.

Configuration

kiro.json (TrustGuard hooks only). ~/.trustguard/kiro.json (chmod 600; path overridable with TRUSTGUARD_KIRO_CONFIG). It never holds MCP values. Precedence: environment > user file > managed file > default. When the managed file includes api_key, data_url, api_key, and fail_mode are locked. mcp.json (TrustGate only). Two scopes: Deployment ownership.

Attributes

  • attributes.collector.type = "ide"
  • attributes.source.application = "kiro-plugin"
  • attributes.kiro: the non-content hook fields, such as the event name and cwd
  • attributes.tool.name for shell commands and tool results; for MCP tool calls the name is on the payload (params.name)
  • consumer_id and attributes.user.email only when set in kiro.json. Kiro does not expose the account email to hooks
Set consumer_id (for example through MDM or TRUSTGUARD_CONSUMER_ID) to get per-developer attribution in Activity. Gate on source.application and/or tool.name / tool.command.

Troubleshooting

Logs. The plugin log is ~/.trustguard/logs/kiro/calls.jsonl. By default it records only blocks, denials, taints, and errors, without content. Set "debug": true to log every call with its request; this can include the sensitive data TrustGuard is masking, so turn it off afterwards. The API key is never logged. Kiro’s own log shows whether hooks fired and what they returned: ~/Library/Application Support/Kiro/logs/<timestamp>/window*/exthost/kiro.kiroAgent/Kiro Logs.log.