agentleFS
kaandgnshkaandgnsh/Claude-Blue/skills/security-automation/soar-playbook-design/SKILL.md

soar-playbook-design

Skill0 starsChanged 14 days agoMITView on GitHub

Design a SOAR or automation playbook as an explicit step graph with triggers, inputs, enrichment, decisions, approval gates, rollback, timeouts and a kill switch, then lint it with a bundled checker. Use when designing a new SOAR playbook, porting one between platforms (Sentinel Logic Apps, Splunk SOAR, XSOAR, Tines, Torq, Shuffle), or reviewing whether an existing playbook can fail safely.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep human: scoping, attribution, legal/HR decisions, anything irreversible (deleting mailboxes, wiping devices).

    line 24
  2. Distinctive:

    Write the playbook in this vendor-neutral JSON before building it.

    line 28
  3. Very specific:

    Fail to a human: Every on_error and default ends in an analyst task with the context gathered so far, never in a silent stop.

    line 78

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SOAR Playbook Design

Design the playbook on paper as a graph first, lint the graph, and only then click it together in the vendor editor. Most production incidents caused by automation come from paths nobody drew: the null branch, the retry loop, the connector that hangs.

1. Decide whether to automate at all

Automate a step when all are true:

  • The step is executed the same way by every analyst today (written runbook exists; see runbook-authoring).
  • Volume justifies it (rule of thumb: > 20 executions per week, or the step blocks MTTR).
  • Inputs are structured fields, not free text an analyst interprets.
  • A wrong result is either harmless (enrichment, notification) or reversible and gated (containment).

Keep human: scoping, attribution, legal/HR decisions, anything irreversible (deleting mailboxes, wiping devices).

2. Model the playbook as a step graph

Write the playbook in this vendor-neutral JSON before building it. Every platform maps onto it.

{
  "name": "phish-reported-email",
  "owner": "soc-automation",
  "kill_switch": "Disable Logic App 'pb-phish' or set flag automation/phish=off in the config list",
  "start": "parse",
  "steps": {
    "parse":   {"type": "query", "timeout_s": 60, "next": "enrich"},
    "enrich":  {"type": "enrich", "timeout_s": 120, "on_error": "manual", "next": "verdict"},
    "verdict": {"type": "decision", "branches": {"malicious": "approve", "benign": "close"}, "default": "manual"},
    "approve": {"type": "action", "action": "purge_message", "destructive": true, "approval": "soc-l2",
                "rollback": "restore_message", "idempotency_key": "{{message_id}}", "timeout_s": 300,
                "on_error": "manual", "next": "notify"},
    "restore_message": {"type": "action", "action": "restore_message", "timeout_s": 300, "approval": "soc-l2",
                "rollback": "purge_message", "destructive": false, "next": "notify"},
    "notify":  {"type": "notify", "next": "end"},
    "manual":  {"type": "notify", "next": "end"},
    "close":   {"type": "notify", "next": "end"},
    "end":     {"type": "end"}
  }
}

Step contract:

FieldMeaning
typequery, enrich, decision, action, notify, wait, end
next / branches / defaultSuccessors. A decision must have a default for values nobody planned for
timeout_sRequired on every external call
on_errorWhere a connector failure goes (usually a "hand to analyst" step)
destructive, approval, rollback, idempotency_keyRequired for anything that changes state in production
auto_approved_by, exclusionsOnly for pre-approved automatic containment (see automated-containment-guardrails)
max_iterationsRequired on any step that loops (polling, retries)
paramsConnector parameters. Credentials are vault references, never literals

3. Lint the graph

python3 scripts/playbook_lint.py playbooks/*.json --fail-on high

The linter reports dangling and unreachable steps, paths that never reach end, loops without max_iterations, decisions without a default, disruptive actions (explicit or by verb: isolate, disable, revoke, purge, ...) without approval/rollback/idempotency key, auto-approved actions without exclusions, external calls without timeouts, a missing owner or kill switch, and literal secrets in params. Exit code 1 when any finding reaches --fail-on; run it in CI next to the exported playbooks.

4. Design rules

  1. Trigger narrowly. Bind to specific analytic rule IDs, not "any high-severity incident". Record the rule IDs in the playbook description.
  2. Enrich before you decide. Decisions read fields, never raw text. Normalize verdicts to a small enum (malicious, suspicious, benign, unknown).
  3. Fail to a human. Every on_error and default ends in an analyst task with the context gathered so far, never in a silent stop.
  4. Write back. Each step comments on the incident: what ran, inputs, result, duration. The case must be reconstructable without the SOAR run history (which often expires after 30-90 days).
  5. Idempotency. Re-running the playbook on the same incident must not double-act. Key actions on the entity (message ID, user object ID, device ID).
  6. Least privilege connectors. One managed identity or service account per playbook, scoped to the actions it performs. A phishing playbook does not need User.ReadWrite.All.
  7. Kill switch. A single documented control (disable the workflow, feature flag in a watchlist/config table) that stops all instances. Test it.

5. Platform mapping notes

ConceptSentinel (Logic Apps)Splunk SOARCortex XSOARTines / Torq
Approval gateTeams/Outlook approval actionprompt blockData collection task / manual taskPrompt / Approval step
TimeoutAction retry policy + timeout settingBlock timeoutTask timeoutAction timeout
Kill switchDisable the Logic App; automation rule orderDisable playbook / set inactiveDisable playbook triggerDisable story / workflow
SecretsManaged identity, Key Vault referenceAsset configCredentials storeCredentials / secrets store

Output

  • Step-graph JSON committed next to the exported vendor playbook.
  • Linter output with zero high/critical findings or a documented exception.
  • Runbook link, owner, kill switch and the analytic rule IDs that trigger it.

Related skills

playbook-testing, automation-risk-review, automated-containment-guardrails, enrichment-automation, runbook-authoring, alert-triage

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.