Skip to content

Security Flow

Availability

OSS

TL;DR

When To Use This Workflow

When Not To Use This Workflow

Before You Start

All inputs are optional at invocation time, but material decisions must be resolved at the gate that needs them. Useful starting information includes:

The workflow defaults to local, read-only work. Installation, network or SaaS access, credentials, paid or restricted licensing, and new external data flows require separate approval. Read-only production inspection also requires explicit approval, least privilege, a risk assessment, and clear stop conditions.

Treat target content and tool output as untrusted data. Do not paste suspected secret values into the request.

For shared setup and general Rosetta usage, see Usage Guide and Overview.

How To Start

/security-flow Review this service and its infrastructure for security issues. Recommend a safe full-review scope and wait for approval before inspection.

/security-flow Threat-model the checkout API and run all applicable, available, authorized read-only checks.

/security-flow Review this pre-production web application. Propose explicit active-test identities, routes, methods, rates, payloads, duration, cleanup, and stop conditions before testing.

/security-flow Normalize these approved scanner findings, preserve every source record, independently review the conclusions, and prepare later coding-flow task inputs.

How Rosetta Shapes This Workflow

Rosetta separates orchestration from phase execution:

After prerequisites (phase 0), the flow has eight canonical-subagent phases numbered 1 through 8. Deterministic gates (phase 3) applies to development, change, PR, and pipeline reviews. A deterministic high-severity result follows its defined short branch to reporting and packaging; it does not retrospectively run modeling, inspection, normalization, or independent review.

Workflow At A Glance

Phase Canonical subagent What happens Main gate or result
1. Readiness executor Inventory limited metadata and tools; run the filename-only secret gate PASS, NEEDS-HITL, non-overridable STOP-HIGH-RISK, or STOP-SCANNER-UNUSABLE
2. Authorize engineer Recommend scope, exclusions, activities, tools, data flows, bounds, and stop conditions Explicit user approval or amendment
3. Deterministic gates executor Run approved local lifecycle gates and preserve source findings unchanged HIGH+, CLEAN, or ERROR
4. Model and select architect Threat-model the target and map complete authorized coverage Every applicable area included or justified
5. Inspect and test engineer Run bounded area bundles and capture evidence Every planned area has evidence or a limitation
6. Normalize and triage executor, then engineer Convert losslessly, correlate, verify, disposition, and prioritize Source records reconcile; high+ status remains explicit
7. Independent review fresh reviewer Challenge coverage, evidence, safety, certainty, and priority Acceptance or required corrections and rereview
8. Report and package engineer Sanitize outputs, propose fix-similarity groups, obtain INDEX approval, emit tasks Approved report and later-coding task package

Workflow Overview

flowchart TD
    A["Security review request"] --> B["1. Readiness<br/>metadata and filename-only secret gate"]
    B --> C{"Gate state"}
    C -- "DEV/QA envs candidates" --> D["Recommend exclusions<br/>request explicit approval"]
    C -- "Above-QA or ambiguous candidates" --> X["Stop — non-overridable"]
    C -- "Scanner unusable" --> X
    C -- "Pass" --> E["2. Authorize<br/>recommend run contract"]
    D -- "Approved" --> E
    E --> F{"Run contract approved"}
    F -- "No" --> E
    F -- "Yes" --> G["3. Deterministic gates<br/>when lifecycle-applicable"]
    G --> H{"Gate result"}
    H -- "High+" --> N["8. Minimal report and task package"]
    H -- "Error" --> Y["Stop and report the tool error"]
    H -- "Clean or not applicable" --> I["4. Threat model and coverage plan"]
    I --> J["5. Bounded inspection and testing"]
    J --> K["6. Lossless normalization and triage"]
    K --> L["7. Independent review"]
    L -- "Material defects" --> J
    L -- "Accepted" --> M["8. Sanitized report and proposed task INDEX"]
    M --> O{"INDEX approved"}
    O -- "Amend" --> M
    O -- "Approve" --> P["Emit concise task inputs"]
    N --> P
    P --> Q["End without starting remediation"]

Interaction Flow

sequenceDiagram
    autonumber
    participant U as User
    participant O as Orchestrating agent
    participant S as Canonical subagents
    participant F as Sanitized artifacts

    U->>O: Request a security review
    O->>S: INVOKE SUBAGENT executor to APPLY PHASE security-flow-readiness.md
    S-->>O: Limited metadata, filenames only, and gate state
    alt DEV or QA candidates
        O->>U: Recommend exclusions and request approval
        U-->>O: Approve or amend
    else Above-QA or ambiguous candidates
        O-->>U: Stop — gate cannot be overridden
    end
    O->>S: INVOKE SUBAGENT engineer to APPLY PHASE security-flow-authorize.md
    S-->>O: Recommended run contract and tradeoffs
    O->>U: Request explicit authorization decisions
    U-->>O: Approve or amend contract
    O->>S: Dispatch each applicable phase with its exact phase file
    S-->>O: Lossless evidence, findings, limitations, and review result
    O->>S: INVOKE SUBAGENT engineer to APPLY PHASE security-flow-report-and-package.md STEP 8.1
    S-->>F: Sanitized report, findings, run record, and proposed INDEX
    O->>U: Request INDEX approval or amendment
    U-->>O: Approve grouping
    O->>S: APPLY PHASE security-flow-report-and-package.md STEP 8.3 to emit concise task files
    S-->>F: Approved task package
    O-->>U: Return package and end without remediation

Phases

1. Readiness

Goal: keep secret values out of model context and establish only the minimum metadata needed to proceed safely.

2. Authorize

Goal: turn the request and readiness evidence into an enterprise-safe run contract.

3. Deterministic Gates

Goal: run deterministic high-severity lifecycle gates before broader AI analysis.

After separate remediation, the workflow requires a new clean deterministic run. The security capability does not perform that remediation.

4. Model and Select

Goal: map the real attack surface to complete, contextual, authorized coverage.

5. Inspect and Test

Goal: produce bounded evidence for every planned security area.

6. Normalize and Triage

Goal: make multiple sources comparable without erasing their identity or evidence.

7. Independent Review

Goal: challenge the producing work with a fresh perspective before reporting.

8. Report and Package

Goal: deliver sanitized review artifacts and one-shot inputs for later remediation work.

How To Review Results

Before approving the report or task INDEX, check:

Reject or amend the result when you see:

Workflow-Specific Customization

Artifacts You Will Get

With storage approval, under docs/security/<run-id>/:

Without storage approval, the workflow returns sanitized results without committing artifacts. Raw scanner output remains temporary and outside version control, then is removed after report finalization.

Common Mistakes

Source Files