/headless-cloud-security:sysdig-runtime-remediatefrom headless-cloud-security
Proposes and executes response actions for Sysdig runtime threats with blast radius analysis and user confirmation. Use for isolating, killing, or pausing containers. Not for vulnerability fixes or investigation.
Ships in headless-cloud-security. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Before doing any other work for this skill, follow references/first-run-notice.md exactly.
This skill describes steps by capability, not by tool name: ask a structured question, get explicit confirmation, write a file, run a command. Follow references/agent-capabilities.md for how to do each one with your agent's tools, and what to do when a capability is missing — including when nobody can answer a question.
This skill's outputs — response actions and tickets — are rendered by their own systems, so on-brand styling doesn't apply to them. If you're ever asked to produce a custom report or document instead, keep it on-brand per references/on-brand-output.md (or hand off to the sysdig-report skill, if it's installed) — opt-in guidance, never a requirement.
Three invocation forms:
/sysdig-runtime-remediate — no argument. Ask the user for an event_id./sysdig-runtime-remediate <event_id> — directed. Load the case for that event.sysdig-runtime-investigate — the predecessor skill invokes this one with the event_id already loaded. Open with: "sysdig-runtime-investigate handed off <event_id>. Loading the case file and starting Step B (architecture probe)."The flow is Steps A through F, not rigid phases. Steps describe shape; the LLM decides ordering within and across them when the signals support it. The hard guardrails are non-negotiable:
references/consequence-analysis-guide.md), reversibility, and the undo path. Then ask.done / pending / in_progress / failed / skipped / cleared / still_active / inconclusive.Step A ──→ Step B ──→ Step C ──→ Step D ──→ Step E ──→ Step F
Understand Probe Propose Execute Watch Report &
context blast actions (per- (~5 min) persist
radius action)
Run all of these before Step A. Surface a single one-line connectivity summary at the end.
references/trust-preamble.md verbatim. Do not pause for confirmation; the preamble is informational.references/auth-preflight.md and follow its instructions exactly. This skill requires the Sysdig MCP for state, event lookups, and Response Actions — degraded mode is not supported. If the preflight returns State 2 (registered but not authenticated) or State 3 (not reachable), emit its verbatim message and stop — no data calls, no state read, no file writes.list_response_actions once (no arguments). If it errors, surface the message and stop — the Response Actions API is unreachable, so nothing can be remediated. Success only proves the API is reachable and returns the tenant-wide capability catalog — it does not mean any given action can execute on this cluster or host. Per-scope responder availability (a CLUSTER responder may not be deployed on the target cluster) and remote-storage configuration (needed by output-producing actions) are tenant/cluster-specific and are confirmed later, in Step C and at submit time. Do not promise the user an action is runnable on the strength of this canary alone.command -v kubectl and command -v aws. Record availability. Do not ask to authorize either surface yet; that happens in Step D when an action actually needs it.mcp__atlassian__* (Jira) and the standard PagerDuty env vars. Used by the file-as-ticket fallback in Step D.Connectivity line example:
Sysdig ✓ · MCP ✓ · Response Actions API ✓ · kubectl detected (unauthorized) · aws detected (unauthorized) · Jira ✓ · PagerDuty —. Light tier will use Jira if you decline an action.
Goal: load the threat into memory along with an explicit inventory of what's known and what's missing.
<event_id> argument → load the case directly./tmp/sysdig-runtime-investigate-<event_id_short>-*.md. If it exists, read it and treat the contents as authoritative for what the threat is and where it lives.sysdig-runtime-investigate <event_id>. When it completes, read the new case file and continue.Known:
- event.id, threat type, MITRE tactic
- cluster, namespace, workload kind/name, container id, process tree
- cloud account / identity (AWS / GCP / Azure, if surfaced), correlated CVEs
- prior investigation handoff (Jira/PagerDuty ticket, if any)
Gaps:
- <e.g.> ServiceAccount and RBAC not yet enumerated
- <e.g.> Cloud identity not confirmed
- <e.g.> Inbound/outbound Service map unknown
Goal: produce the mini-map described in references/consequence-analysis-guide.md. Read-only — no destructive ops here, no authorization gate beyond per-surface read access.
references/architecture-probing.md under the "Sysdig MCP — SysQL recipes" section. Workload identity, Service/Ingress map, ServiceAccount + RBAC, cloud identity.kubectl config current-context (read-only, pre-authorized) and compare it against the threat's kubernetes.cluster.name. If they clearly mismatch, say so plainly — "Local kube-context is <ctx>, but the threat is on <cluster>; kubectl probing here would target the wrong cluster" — and do not offer the grant. Instead offer to skip kubectl (continue MCP-only, degraded) or let the user switch context and re-run Step B. Only when the context matches (or you can't tell) ask: "Authorize read-only kubectl access (get, describe, logs) for cluster <context> for this session? This lets me probe pod ownership, NetworkPolicy state, PDB/HPA constraints, and sidecars. yes / read-only / no." On yes or read-only, run the kubectl recipes from architecture-probing.md. On no, declare the gap and continue with degraded fidelity.FETCH_CLOUD_LOGS, IAM_QUARANTINE), which are provider-uniform — see references/response-actions-catalog.md. For AWS, when the AWS CLI is detected, first verify the active credentials match the threat's account. Run aws sts get-caller-identity (read-only, pre-authorized) and compare the returned Account against the threat's aws.accountId. If they mismatch, say so — "Active AWS profile is account <id>, but the threat is in <accountId>; these reads would hit the wrong account" — and do not offer the grant; offer to skip (note the cloud-identity gap) or let the user switch profile and re-run. Only when the account matches (or you can't tell) ask: "Authorize read-only AWS CLI access with profile <profile> for account <id> for this session? This lets me check the IAM role, attached policies, and recent CloudTrail activity. yes / read-only / no." On yes or read-only, run the AWS recipes from architecture-probing.md.consequence-analysis-guide.md. Lead with workload identity, then inbound, outbound, sidecars, cloud identity, PDB/HPA, RBAC. Cite the source for every line.Goal: a single, ordered checklist of candidate actions, each with its full consequence analysis. Accept user response as either checkbox selections or natural language.
Discover applicable actions. Call list_response_actions with context_event_id: <event_id> to get Sysdig's tenant-specific catalog with parameter schemas, scoped to the event's responder context. Two outcomes:
{"data":[]}) → this is inconclusive, not "nothing is possible" (the API can't always resolve responder availability from event context alone). Fall back to the full catalog (call list_response_actions with no context_event_id) and apply the availability preflight below.Pair the catalog with the threat patterns in references/threat-patterns.md and your reasoning over the investigation + probe findings.
Availability preflight (before you propose). There is no read-only "list responders / storage config" endpoint, so confirm what can actually run using the cheap signals available, and be honest about residual uncertainty:
responderType (HOST / CLUSTER / CLOUD). A CLUSTER responder may not be deployed on the target cluster; submitting then returns HTTP 400 responder_not_found. Use list_response_actions with context_event_id (if non-empty) and list_response_action_executions (which responderTypes have recently completed in this tenant) as hints. When unconfirmed, label the action's availability unconfirmed rather than available.GET_LOGS, CAPTURE, and FILE_ACQUIRE write artifacts and require capture storage; without it they return HTTP 412 storage_not_configured. Before proposing them, call get_capture_storage: if it returns isEnabled: false or no bucket, mark these storage-dependent actions unavailable up front rather than discovering the 412 at submit.KILL_CONTAINER, STOP_CONTAINER, PAUSE_CONTAINER, container-scoped FILE_ACQUIRE) need a runtime container.id. If neither the event payload, the process tree, nor a context-matched kubectl can supply it, mark the action un-parameterizable and don't propose it as runnable.responder_not_found, mark all remaining same-scope candidates unavailable; on storage_not_configured, mark all storage-dependent candidates unavailable — then re-present the revised set instead of marching the user through actions that will fail identically. See Error handling.Build the checklist. For each candidate action, render the format from consequence-analysis-guide.md:
[ ] <ACTION_TYPE> (<short scope, e.g. "PID 4823 in container abc123">)
What it does: <one sentence>
Expected: <intended effect, where it shows up>
Breaks: <concrete consequences pulled from Step B>
Reversibility: <yes via undo / no — explain how>
Surface: <Sysdig API / kubectl / AWS CLI>
Responder: <HOST / CLUSTER / CLOUD — availability: confirmed | unconfirmed>
Preconditions: <e.g. needs RA storage / needs container.id (resolved? y/n) / needs CLUSTER responder>
If an action's availability is unconfirmed or a precondition is unmet, say so in the line and order it accordingly — don't present a likely-to-fail action as the confident first move.
Order with explicit reasoning. Lead the list with the action you'd recommend first; explain why this order in one or two sentences referencing what Step B found. Per the generic principle in threat-patterns.md: evidence first, containment second, destruction last. Prefer actions whose availability is confirmed over unconfirmed ones when they achieve the same containment.
Ask once. As a structured question with a free-form option: "Pick which actions to run, in this order, or describe what you'd prefer in your own words." Accept structured selections or free-form descriptions; parse natural-language responses against the action list and confirm your interpretation back to the user before proceeding.
For each accepted action in the proposed order:
reversibility = no, include: "This action is not reversible by the API. If you change your mind, recovery requires <concrete manual step>."kubectl mutating, aws mutating) and you only have read-only authorization for that surface, ask now: "This action needs write access to <surface> (specifically: <command shape>). Authorize for this action? yes / no (file as ticket instead)."submit_response_action with action_type and parameters. Capture the execution id from the response, then poll get_response_action_status with that action_execution_id until status is COMPLETED or FAILED. Surface the result inline.<ACTION> <status>. <key detail>. Next: <NEXT_ACTION>."Only if at least one action ran (status executed). Skip if everything was filed or skipped.
list_runtime_events at ~30 s intervals, up to 10 polls (~5 min), filtering for the same rule that fired on the same workload.cleared — full window, no re-fires.still_active — at least one re-fire. Surface the new event id, prompt the user to consider next steps (escalate to a heavier action, file a ticket).inconclusive — the workload disappeared mid-window (action was successful enough to remove the watch target). Treat as success-with-caveat.cleared / still_active / inconclusive), then the actions taken. Mention any filed tickets explicitly.Apply the standard three-line error template (what / why / fix) for every failure path. Keep messages under four lines. Examples:
Response Actions API returned 403 on
submit ISOLATE_NETWORK. Your token is missing thecontainment-response-actions.execpermission. Either ask an admin to grant it, or pickfile as ticketto record the proposed action and re-run after the grant.
submit ISOLATE_NETWORKreturned HTTP 400responder_not_found(scopeclusterName:<cluster>). No CLUSTER responder is deployed on that cluster — only the node/host agent is registered. Mark every remaining CLUSTER-scope actionunavailable, re-present the revised set (HOST/CLOUD only, plus file-as-ticket), and recommend deploying the Sysdig cluster responder for in-product remediation. Do not submit the other CLUSTER actions — they fail identically.
submit GET_LOGSreturned HTTP 412storage_not_configured. This action stores an artifact, but Response Actions remote storage isn't configured in the tenant. MarkGET_LOGS/CAPTURE/FILE_ACQUIREallunavailablefor this run; ask an admin to configure RA remote storage, or proceed with non-storage actions (ISOLATE/KILL/restart).
kubectl probe failed:
error: You must be logged in to the server (Unauthorized). The current kube-context's credentials expired. Refresh withkubectl config use-context <ctx>/ SSO login, then re-run Step B.
Watcher couldn't find the container in
list_runtime_events. The container ID is gone — the kill succeeded. Closing the watcher asinconclusive(success-with-caveat).
A Sysdig MCP call came back denied (the agent refused it, not a server error). Permissions issue, not an auth/reachability failure — your agent's settings don't pre-approve that tool. Approve the tool name shown in the denied call in your agent's permission settings (in Claude Code,
mcp__<actual-server-name>__*), and re-run. See the "Tool calls come back denied" section inreferences/mcp-setup.md. Do not retry the denied call.
/sysdig-runtime-remediate invocation.undo_response_action with action_execution_id: <id> — in the report and in the chat summary.sysdig-runtime-investigate: "sysdig-runtime-investigate handed off <event_id>. Loading the case file and starting Step B."<event_id>. Handing off to sysdig-runtime-investigate to build the case file — I'll resume here once it returns."<ACTION>. Filing it as a <destination> ticket with the exact command and rationale so a human can run it manually."references/agent-capabilities.md (opens in a new tab)references/architecture-probing.md (opens in a new tab)references/auth-preflight.md (opens in a new tab)references/consequence-analysis-guide.md (opens in a new tab)references/first-run-notice.md (opens in a new tab)references/mcp-setup.md (opens in a new tab)references/on-brand-output.md (opens in a new tab)references/response-actions-catalog.md (opens in a new tab)references/threat-patterns.md (opens in a new tab)references/trust-preamble.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub sysdig/skills --plugin headless-cloud-security8 skills in this plugin
/sysdig-account-setupBaseline account setup for Sysdig Secure after a tenant is connected. Guided, interactive, modular setup via the Sysdig MCP server: (1) access baseline — teams, users, and roles; (2) vulnerability management policy baseline — Pipeline vs runtime, one policy or split; (3) compliance standards — assign posture policies (CIS, PCI, NIST, …) to zones; (4) runtime threat-detection — enable/disable the recommended managed detection policies. Reviews current state, proposes a structure, and applies changes idempotently with explicit confirmation before anything that mutates the tenant. Use right after onboarding to leave an account usable out of the box. Fine-grained policy tuning is out of scope.
/sysdig-investigateInvestigate and prioritize vulnerable images in a Sysdig-monitored environment via two flows, routed from the user's goal. Plans flow — plan-driven prioritization: pick an admin-configured Plan (or explore ranked jobs under an ad-hoc scope and measure) and walk the prioritized remediation jobs one at a time. Findings flow — ad-hoc findings analysis: filter, regroup, sort, and page vulnerability findings the way the Vulnerability Management UI table does. Hands any chosen image off to /sysdig-remediate, which owns tickets, PRs, job tracking, and job closing. Triggers on: "investigate", "what should I fix", "what should I fix first", "show me my vulnerable images", "prioritize vulnerabilities", "which images are affected by CVE-...", "show me all Critical CVEs in production", "/sysdig-investigate". Not for opening PRs, applying fixes, or creating/updating tickets — use /sysdig-remediate for all of those.
Other plugins' skills for the same job