incident-response
Run a live incident: impact first, stabilise before root cause, roll back before you debug, one change at a time, an append-only timeline, recovery only on an observed signal. Includes the leaked-secret containment order (revoke or rotate, scope the exposure, purge, prove the old credential dead, record).
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 12
- Forks
- 2
01 前言 Front Matter
- name
- incident-response
- license
- MIT
- metadata
- { "polyrob-when": "Something is broken live, or a secret leaked", "polyrob-version": "2", "polyrob-priority": "2", "polyrob-requires": "[\"secret-handling\"]", "polyrob-owner-only": "true" }
- description
- Run a live incident: impact first, stabilise before root cause, roll back before you debug, one change at a time, an append-only timeline, recovery only on an observed signal. Includes the leaked-secret containment order (revoke or rotate, scope the exposure, purge, prove the old credential dead, record).
02 资源文件 1
- 参考文档references/incident-record.md3.6 KB
03 SKILL.md 正文
Incident Response
An incident is something broken or unsafe RIGHT NOW: a service down or wrong, money moving that should not, a credential in the wrong hands. The job is to stop the damage first and understand it second. Recommended procedure — adapt it to what you can reach this session.
When to use
- A production service, bot, app or endpoint is down, erroring or giving wrong results for real users.
- Funds moved, or are about to move, in a way nobody approved.
- A key, token, password, seed phrase or private key was exposed (pasted, committed, logged, posted).
Not for: an ordinary bug with no live impact (use coding-workflow), or a
review after the fact with nothing still broken (write the record from
references/incident-record.md and stop).
The rules
- Impact first. Before any fix, establish: what is broken, for whom, since when, whether money or a secret is at risk, and whether it is getting worse. Set a severity (S1/S2/S3, defined in the reference) from what you observed, not from how alarming the alert sounds. If you cannot measure the reach yet, use the higher level until you can.
- Tell the owner early. Your first
send_messagegoes out as soon as you know the impact — not after you know the cause. See "Telling the owner". - Stabilise before root cause. Stop the bleeding with the smallest safe action: roll back, turn a feature off, pause a loop, stop a job. Root-cause work starts only when the damage has stopped.
- Roll back before you debug. If the trouble started after a change (a deploy, a config edit, a new dependency, a new goal or cron job), returning to the last known good state is the default first move. ⚠️ Never edit files on a live server and never copy a single file onto it. Roll back or fix forward only through the normal deploy path (for this codebase, the deploy scripts and their backup). If you cannot deploy, give the owner the exact rollback target and the command.
- One change at a time. Say what you will change before you change it, record it after, and watch the signal before the next change. Two changes at once make it impossible to tell which one helped or hurt.
- A mitigation is not a fix. For each one, record what changed, where, whether it is temporary, and what will remove it. A temporary measure nobody wrote down becomes permanent.
- Recovery is observed, never assumed. Name the signal (an error rate, a health check, a balance, a successful test call), the value that counts as healthy, the value you saw and when. "I applied the fix" is not recovery. If the signal itself is unavailable, the incident stays open and you say which signal is missing.
- Keep an append-only timeline in the session workspace (format in the reference): what was seen, what was changed, what was decided, each with a time and the reason as believed then. Correct an entry with a new entry; never rewrite one.
When money is at risk
- Ask the owner to
/pausethe affected scope (e.g. trading) or/halteverything. Callautonomy_controlyourself only when the owner explicitly asks you to stop; only the owner can/resume. - Do not move funds on your own initiative to "save" them. Moving funds is an
owner decision: if the owner wants it, put the move in front of them with
propose_action(a/sendquote card they confirm). If that action is unavailable, give the/send …line WITHOUTgo, and say that no card was made. - A refusal "unaccounted wallet submission … reconcile before …" (another send,
or further spending) freezes every on-chain and x402 send by design. Do not
retry. Read the tx (
defi_data.wallet_activityor the explorer), give the owner the reference, and say that the release is an operator step on the server (the terminal commandspolyrob wallet submissions, thenpolyrob wallet release-submission <ref> --charge-usd N, labeled as terminal commands). - Cut standing authority in this order: the dapp session
(
dapp_browser.dapp_disconnect; the owner's/dapp revoke <session-id>), then the token allowance (defi_trade.revoke_approval) or the NFT operator approval (defi_trade.nft_revoke_approval), then the open approvals on an owned NFT account (agent_nft_revoke_all). Dry-run each revoke first. If the turn cannot broadcast it, give the owner the verb to run. - A transfer that says
BROADCAST BUT NOT CONFIRMEDand a bridge that isin_flightare never sent again: check the reference first (defi-bridge). wallet_sign_statuslists the stored site credentials (ids and fingerprints only); a leaked one is cut at the site that issued it.- Do not touch an unknown token, airdrop or contract that appeared in the wallet. Interacting with it can be the attack.
Leaked secret — containment order
Follow the secret-handling skill throughout: never repeat the value, refer to
the credential by its env-var name, show at most a fingerprint. Then work in
this order:
- Revoke or rotate first. Every minute the old value works is exposure. Have the owner issue a replacement at the provider, set it under the same env-var name, and restart; then revoke the old one at the issuer. The env files are the owner's to edit — never yours. If revoking first would break a critical service, the owner may rotate in first; the old value still dies within this incident, not later.
- Scope the exposure. What the credential could reach (read, write, spend, admin), where it leaked (chat, a commit, a public repo, a log, a post), whether that place is public, and the exposure window from the first leak to the revoke. Read the issuer's access log for that window if you can, or ask the owner to. Note any use you cannot attribute.
- Purge. Remove the value from the files, logs, memory entries, notes and drafts you control. Rewriting git history is the owner's decision, comes only AFTER rotation, and does not reach clones, forks, caches or anyone who already read a public push — that is why step 1 comes first.
- Prove the old credential is dead. A successful revoke command only says the request was accepted. Proof is a call with the old credential being rejected, or the issuer's console showing it revoked. If you cannot check without handling the old value, ask the owner to confirm.
- Record. In the timeline: the credential's name and fingerprint, where it leaked, the window, what the issuer log showed, each step and its proof, and what will stop a repeat (an ignore rule, a pre-commit secret scan).
⚠️ A wallet seed phrase or private key cannot be revoked or rotated. The only containment is moving the funds to a new wallet the owner creates — an owner decision, and an urgent one. Tell the owner at once, send nothing more to the exposed address, and never ask the owner to show you the seed.
Telling the owner
send_messageis your only reply channel. A notice counts as sent only when the call returns success; if it fails, record that and try another reachable route (e.g.email).- First message: what is broken, who is affected, the severity, what you are doing now, what you need from the owner, and when you will update next.
- Then update on each change of state, not on a timer. State only causes you observed and recoveries you verified. Say "suspected" when it is a guess.
- For a decision with a few clear options (roll back or hold), use
owner_ask(question=…, options=[…]). An autonomous run cannot wait, so keep the safe state until the owner answers. - Never include a secret value, a full key or a seed phrase in any message, even to the owner.
Closing
Close only when: recovery is observed on the named signal, every temporary
mitigation is removed or listed as a follow-up with an owner, and, for a
leaked secret, the old credential is proven dead. Then write the closing
record with
read_skill_resource(skill_id="incident-response", resource_path="references/incident-record.md")
as the template, and send the owner a short summary.
04 同仓库更多 Skills
echo-basics
How to use the echo tool from the echo fixture pack.
x-engagement
Operate X account communication on the API rail (the captured-browser rail only where the owner chose it)—read inboxes, post/reply, send DMs, set up the account, with the real write gates and completion evidence
social-discovery
Discover public X/social accounts and conversations with AnySite first (anysite_describe, then anysite_api), using native X account reads where they are authoritative and preserving write gates
polymarket-trading
GATED: place/cancel Polymarket orders. Owner-only, read-first, >$500 confirmation gate; references crypto-trading-safety
polymarket-portfolio-review
Read the configured Polymarket account's positions and trade history from the public Data API (no address parameter); summarize exposure and P&L
polymarket-market-research
Read Polymarket markets (discover, details, price as implied probability, orderbook, spread, volume) with no wallet