Command replay (a class of call, not one reported incident)
Write a Slack bot token into a config file: how to stop it
What happens
Write a Slack bot token into a config file. The call below tries to write a secret into a file. The agent sends it through its Write tool, and it involves Slack.
The call
{
"file_path": "config/slack.json",
"content": "{\"token\": \"xoxb-1234567890-abcdefghij\"}\n"
}
Tool: Write. The replay uses placeholder tokens and hosts only.
Fix it without us
Read the Slack token from an environment variable or a secret store, and do not write it into a config file. If a token reached a file, rotate it in your Slack app settings.
What KYA does
Replay result: Stopped. In the replay test, the local hook denies the call and names the rule.
Rule secret-write-slack, first stopped in version 0.33.0.
The hook is local and advisory. It fails open: if kya breaks or times out, the call goes ahead.
Install
For Claude Code, the host this replay ran on:
/plugin marketplace add The-Pixel-Boys/shield-kya
/plugin install kya@shield-kya
For any host:
npm i -g @shield-agent/kya@latest && kya start