Source: https://velofy.co/research/papers/dexter-red-and-fixit-gated-security-sweeps/

Published: 2026-10-29T00:00:00.000Z
Updated: 2026-11-20T16:10:07.000Z

[RESEARCH](https://velofy.co/research/) / [PAPERS](https://velofy.co/research/papers/)

published

# Gated enterprise security sweeps: architecture of dexter-red and dexter-fixit

Architecture of Dexter's gated security sweep and remediation pipelines: hard gates, vault-only secrets, asd-ste-100 handback, and isolation model.

Dexter, Anish Kr Singh · 29 Oct 2026

Enterprises rarely lose to obscure zero-days; they lose when attackers discover misconfigurations, broken authorization boundaries, and exposed surfaces before defenders close them. As part of our [security research](https://velofy.co/research/security/) and the broader [Dexter multi-agent harness](https://velofy.co/research/papers/dexter-multi-agent-harness/), we built `dexter-red` and `dexter-fixit` to package authorized security testing and verified remediation into one repeatable, hard-gated product surface.

The design starts from an uncomfortable engineering reality: an autonomous agent that can run shell commands and inspect credentials is dangerous if governance lives only in conversational advice. `dexter-red` therefore enforces engagement records, scope boundaries, vault-only secret injection, signature integrity, and audit logging in code, then hands structured findings to `dexter-fixit` to implement minimal tested fixes and emit an ASD-aligned `asd-ste-100` compliance handback.

Facts at a glance:

*   **Command surface:** `dexter red` (arms `DEXTER_RED=1`, `--use-theme red`, and injects the red-mode session brief plus `/red` gate command), with subcommands `console`, `signatures`, and `engagement`.
*   **Operator console:** local `node:http` server bound strictly to `127.0.0.1` with Alpine.js vendored (zero CDN dependencies), guiding 4-step onboarding (engagement → scope → credentials → signatures → launch).
*   **Signature pack:** `velofy-core` v1.0.0 (`signatures/velofy-core/pack.json`), 20 domain rules cross-mapped to Essential Eight and ISM, protected by per-rule SHA-256 hashes and a verified manifest.
*   **Compliance handback:** `asd-ste-100` v1 schema (`src/core/red/report.ts`) emitting `.dexter/red/asd-ste-100.json` and `.dexter/red/asd-ste-100.md` with Essential Eight + ISM crosswalks, retest criteria, and fix references.
*   **Verification recorded:** 12/12 unit tests in `red-mode.test.ts`, 4/4 behavioral evals in `dexter-red.eval.ts`, 4/4 true-positive gate evals in `security-gate.eval.ts`, and 7/7 redteam depth unit tests passing.

## Hard verification gates

`dexter-red` never asks the model to recall engagement constraints from memory. At session start, the workflow reads `.dexter/red/engagement.json` and `.dexter/red/sweep-request.json`, and five non-negotiable gates abort or refuse work whenever violated:

| Gate | Enforcement rule | Failure behavior |
| --- | --- | --- |
| 1\. Engagement record | No testing proceeds without a valid `.dexter/red/engagement.json` (client, `authorizationRef`, scope targets, ROE). | Refuses testing and directs the operator to onboard via `dexter red console`. |
| 2\. Scope in code | Every target is checked against `engagement.scope` (exact hosts, wildcard subdomains, CIDRs, URLs) via `isTargetInScope()` and `checkSweepTargets()`. | Refused across console (HTTP 403), CLI, and session layers; names the amendment path and continues only with in-scope work. |
| 3\. Vault-only credentials | Secrets execute strictly via `smbk run -k red/<name> -- <cmd>`; operator console pipes pasted secrets to `smbk add KEY --stdin` (never argv, never plaintext on disk, never logged). | Missing key asks the operator to add it in the console; missing `smbk` returns HTTP 503 with install instructions. |
| 4\. Mandatory audit log | Every action appends `<UTC ISO> <action> <target> <evidence-file-or-'-'>` to `.dexter/red/audit.log`. | Untracked testing is prohibited; findings are logged as evidenced actions immediately. |
| 5\. Signature integrity | `dexter red signatures` verifies per-rule SHA-256 digests and the pack manifest before testing begins. | Any failed verification or tampering halts the sweep and is reported as a pack-integrity finding. |

A structural rule sits behind the console design: the operator console binds exclusively to `127.0.0.1` and has no unauthenticated public intake. A public credential-paste page would behave like a phishing kit and fail enterprise diligence immediately.

## The five-phase gated sweep pipeline

Once preflight passes, `dexter-red` executes a five-phase pipeline (Phases 0 through 4) over the authorized estate:

### Phase 0 — Preflight

Preflight validates that both `.dexter/red/engagement.json` and `.dexter/red/sweep-request.json` exist, checks every requested target against `engagement.scope`, verifies the `velofy-core` signature pack integrity, notes the active rule set, and loads rules-of-engagement constraints—such as blackout windows and rate limits—into active operating rules.

### Phase 1 — Scoped recon (passive-first)

Reconnaissance starts passively using certificate transparency (CT) logs, passive DNS, and ASN mapping restricted to in-scope domains (`VEL-RECON-003`). The pipeline builds a structured asset inventory table tracking `asset`, `source`, `tech`, `ports`, `takedown-risk`, and `in-scope` status. Active reconnaissance runs only where explicitly permitted by the ROE, with every packet originating from the declared engagement host and every discovery appended to `.dexter/red/audit.log`.

### Phase 2 — Signature-driven deep passes

Each in-scope surface maps to concrete `velofy-core` rules and a specialized depth skill:

| Surface | Signature rules | Depth skill |
| --- | --- | --- |
| Web application | `VEL-WEB-001`..`003` | `redteam-webapp` |
| APIs / Open Banking | `VEL-API-001`..`004`, `VEL-FINT-*` | `redteam-api` |
| Cloud estate | `VEL-CLOUD-001`..`002` | `redteam-cloud` |
| Internal identity | `VEL-IDENT-001`..`003`, `VEL-NET-001` | `redteam-network-identity` |
| Payment rails | `VEL-FINT-001`..`002` | `redteam-fintech` |

For every rule, the sweep executes the defined `check`, captures the required `evidence`, and records `severity` alongside compliance mappings. Crucially, rules that yield no vulnerability are still recorded as tested: proof of coverage matters as much as the list of findings. Alongside the six deepened redteam skills, Dexter also bundles Cloudflare’s `security-audit` skill (pinned at `@c1c8a8c`, mapping research roles to `scout` and general roles to `worker` with its `validate-*.cjs` self-tests verified in Dexter’s test run).

### Phase 3 — Purple validation

For every finding with a detection angle (`VEL-PURPLE-001`), the pipeline drafts a corresponding Sigma detection rule, identifies the required log source, validates the rule structure (the `redteam-purple` skill includes the mandatory engagement-gate prerequisite, a Sigma skeleton, and `sigma-cli` validation), and measures detection coverage alongside the client SOC when present on the engagement.

### Phase 4 — Structured report generation

The sweep writes `.dexter/red/findings.json` containing one `RedFinding` record per finding—carrying `id` (e.g., `F-01`), `signatureId` (`VEL-*`), `title`, `severity`, `cvss40` vector, `target`, `domain`, `description`, `evidence`, `remediation`, `essentialEight`, `ism[]`, `status` (`"open"`), and an exact `retest` condition—and produces a CVSS 4.0-first red report framing business impact in payment and fraud terms. Complete compliance cross-mapping is enforced as a hard reporting requirement (`VEL-REPORT-001`).

## Remediation loop and handback packaging (`dexter-fixit`)

Finding vulnerabilities without closing them leaves the enterprise exposed. `dexter-fixit` consumes `.dexter/red/findings.json` and `.dexter/red/engagement.json` and runs a disciplined remediation loop under five rules:

1.  **Scope still governs remediation:** code edits occur in the client repository only when the engagement authorizes remediation; otherwise `dexter-fixit` emits the handback with remediation guidance, leaves findings `open`, and stops.
2.  **One finding, one fix branch:** each change stays small, reviewable, and mapped 1:1 to a finding ID.
3.  **Every fix carries its retest proof:** the finding’s `retest` condition acts as the test acceptance criterion; a patch without a passing retest is not complete.
4.  **Accepted risks require a named owner:** accepted findings record who accepted the risk and when (`status: "accepted-risk"`) and are never silently closed.
5.  **Fix references must be real:** `fixRef` requires a real commit hash or PR URL; no reference means no `"fixed"` status.

Findings are processed in strict severity order (`critical` → `high` → `medium` → `low`). For each item, the engine plans the minimal patch from the signature’s `remediation` guidance while checking for newly introduced risk, implements the fix and its `retest` test, verifies the test passes, records `status: "fixed"` with `fixRef`, and writes the remediation action to the audit log.

### The `asd-ste-100` v1 handback schema

Once `.dexter/red/findings.json` reflects updated statuses, the report engine (`src/core/red/report.ts`) executes `buildAsdSte100(findings, engagement)` and `renderAsdSte100Markdown(...)` to generate `.dexter/red/asd-ste-100.json` and `.dexter/red/asd-ste-100.md`:

*   **Metadata and overview:** `format: "asd-ste-100"`, `schemaVersion: "1.0.0"`, `metadata` (`reportId`, `classification`, `client`, `engagementRef`, `generatedAt`, `systemUnderTest`), `executiveSummary`, and `testOverview` (`methodology`, `signaturePacks`, `findingsTotal`, `bySeverity`, `byStatus`).
*   **Evidence and crosswalks:** full `findings` records with status and `fixRef`, plus `complianceCrosswalk` indexing every finding under both `essentialEight` mitigations and `ism` controls (any unmapped finding is treated as a bug in the report).
*   **Retest, remediation, and declaration:** explicit `retestCriteria` for outstanding items, a `remediation` breakdown (`fixedWithRefs`, `outstanding`, `acceptedRisks`), and a `declaration` block stating the authorization reference and audit-trail statement.

Because `asd-ste-100` separates the finding data model from its markdown renderer, an organization with its own official STE-100 template can swap the renderer without altering the underlying `RedFinding` schema.

## Verification coverage

The `dexter-red` and `dexter-fixit` implementation is backed by both deterministic unit tests and behavioral evals recorded in Dexter’s v3.2.0 and v4 milestone logs:

*   **`red-mode.test.ts` (12/12 passing):** verifies `red` theme parity, engagement scope matching (exact hosts, wildcards, CIDRs, out-of-scope rejections), signature verification and tamper detection, localhost console routing (`127.0.0.1` bind, fake-`smbk` proof that secrets travel only over `--stdin` and never in argv or plaintext files, HTTP 503 when `smbk` is absent), and `asd-ste-100` report structure.
*   **`dexter-red.eval.ts` (4/4 passing):** verifies refusal when no engagement exists, refusal on out-of-scope targets, vault-only credential enforcement, and `asd-ste-100` handback generation in `dexter-fixit`.
*   **`security-gate.eval.ts` (4/4 passing):** confirms true-positive gating when recon is requested without an engagement ID, when a target falls outside scope, when audit-trail logging is required, and when a purple-team Sigma request arrives without an active engagement.
*   **Redteam depth tests (7/7 passing):** asserts concrete methodology, tool commands, artifact schemas, and the fixed `redteam-purple` engagement-gate prerequisite.

## Dexter’s project-trust and container threat model

Security sweep pipelines run inside a coding agent, so operational safety ultimately depends on Dexter’s own runtime threat model (`docs/security.md`). Dexter treats all model-generated commands and code as untrusted: it runs with the permissions of the operating-system user that launched it, does not prompt before every tool call, and passes those same permissions to extensions, package installers, language servers, and child processes. Files, comments, tool output, and model responses can all steer behavior via prompt injection. Watching the transcript, clicking through project trust, or reviewing diffs after the fact does **not** create a security boundary.

### Execution isolation tiers

| Execution model | What remains protected | Trade-off |
| --- | --- | --- |
| Directly as an OS user | Only what that OS account cannot access. | A dedicated account narrows permissions, but OS and network remain shared. |
| Entirely inside a container, VM, or sandbox | Host files and processes not exposed to the environment. | Strongest practical option; exposed credentials and network services remain reachable inside. |
| Outside isolation, with only built-in tools running inside | Host resources from actions performed through built-in tools. | Narrower boundary: Dexter itself and external extensions stay outside isolation. |

### Project trust boundaries and limits

Project trust governs whether Dexter loads startup resources supplied by a working directory: `.dexter/settings.json`, `.dexter/mcp.json`, `.dexter/extensions`, `.dexter/skills`, `.dexter/prompts`, `.dexter/themes`, `.dexter/SYSTEM.md`, `.dexter/APPEND_SYSTEM.md`, and project `.agents/skills` (in the current directory or an ancestor; a bare `.dexter` directory does not trigger a prompt). Decisions resolve in strict precedence:

1.  Command-line `--approve` or `--no-approve`.
2.  User-level or CLI extensions handling the `project_trust` event (first yes/no wins).
3.  Saved canonical-path decisions in `~/.dexter/agent/trust.json` (closest ancestor applies, managed via `/trust`).
4.  Global `defaultProjectTrust` (default `"ask"`). In non-interactive print, JSON, and RPC modes, `"always"` loads protected resources while `"ask"` and `"never"` skip them unless overridden on the CLI.

Two explicit limits define what project trust is _not_:

*   **Not a complete startup boundary:** Dexter reads the project `sessionDir` setting while selecting or creating a session before resolving project trust; declining trust skips the remaining protected resources but cannot undo that initial lookup.
*   **Not a runtime or context sandbox:** declining project trust does not restrict OS permissions of enabled tools after startup, and context files (`AGENTS.override.md`, `AGENTS.md`, `CLAUDE.md`) still load unless context loading is disabled.

For red-team and remediation engagements, combining `dexter-red`’s code-enforced engagement gates and `smbk` vault isolation with container or VM execution, narrowly scoped short-lived credentials, version-control snapshots before edits, and careful redaction before sharing session transcripts (which retain prompts, tool arguments, command outputs, and file contents) provides defense in depth where neither model refusals nor prompt rules alone would suffice.

## Sources

*   `packages/coding-agent/skills/dexter-red/SKILL.md` (Dexter repository, gated enterprise sweep pipeline)
*   `packages/coding-agent/skills/dexter-fixit/SKILL.md` (Dexter repository, remediation engine and `asd-ste-100` v1 schema)
*   `GOAL.md` (Dexter repository, v3.2.0 redteam-depth and v4 `dexter-red` verification records, 30 October 2026)
*   `packages/coding-agent/docs/security.md` (Dexter repository, execution isolation and project-trust threat model)
*   [Dexter multi-agent harness](https://velofy.co/research/papers/dexter-multi-agent-harness/) and [Velofy security research](https://velofy.co/research/security/)

[← Previous](https://velofy.co/research/papers/decision-bench-v0-first-run/)[Next →](https://velofy.co/research/papers/instinct-agent/)

[← All papers](https://velofy.co/research/papers/)
