Skip to content

Security Engineer: a team member that sweeps, proves, fixes, and keeps holes shut - #625

Merged
FMXExpress merged 2 commits into
mainfrom
claude/pasclaw-desktop-plan-uapzcp
Nov 5, 2026
Merged

FMXExpress merged 2 commits into
mainfrom
claude/pasclaw-desktop-plan-uapzcp

Conversation

@FMXExpress

Copy link
Copy Markdown
Owner

A new team member that sweeps an app for security holes and fixes the security architecture, plus board support that keeps a fixed hole fixed. It was run live end to end, and two bugs the run found are fixed here: one in the role, and one in the gateway's routing that predates this work.

The Security Engineer

  • Role (ROLE_SECURITY). It follows untrusted input from where it enters to where it is used: SQL built from strings, shell commands, eval/exec, paths joined from input, HTML built from input, URLs fetched on a user's say, deserializers. Then it checks secrets, access control, unsafe defaults and crypto. It files only holes it demonstrated: the input sent and what came back. Each is one task with the attack as its criteria and its kind as the cause. It fixes the kind at the boundary (parameterized queries, one path allow-list, secrets from the environment), adds a test that sends the attack, and submits with the attack before and after as evidence.
  • Templates.
    • sec joins software-team on the default tier, not fast, and the kickoff hands it a "Security sweep" task that waits on the build.
    • A new security template (Foreman + Security Engineer) sweeps a project that already exists: pasclaw team up security --project <name>.

Findings on the board

  • task action=create … cause="sql-injection" files the task as a finding. The desktop's POST /v1/projects/<p>/tasks takes cause too.
  • The board snapshots the project as the finding was filed, outside the workspace like a submission's snapshot.
  • rule action=draft can prove a check against that snapshot (it must fail there) and the accepted fix (it must pass). One fixed finding is enough; a reject cause needs two rejects.
  • When a finding's fix is accepted, the finder is told to draft the check, once per cause. A finding the operator filed goes to the team's leads instead.
  • rule list shows each cause's findings, and the desktop's board rows show (finding: <kind>).

Live run (bench/teamboard/LIVE.md, run 4)

The security team was run through the relay provider, with both agents played from their role prompts, against a seeded notes app with three real holes:

  • Found and demonstrated: SQL injection (one owner's search returned another's notes), path traversal (../notes.py returned the source) and a live API key in the source.
  • Fixed and verified: all three fixed by the Security Engineer; the Foreman re-ran each attack and the tests before accepting.
  • Checks: three proven on the first draft and approved in Needs you. Each one also catches a new instance of its kind added elsewhere in the app.
  • Rotation: the Foreman asked the operator to rotate the leaked key (outside the workspace) without blocking the code fix.

Fixed from the run:

  • Needs you was unreachable in a running gateway. /v1/decisions and /v1/needs-you were 404 because IsDesktopPath never listed them, so the desktop could not show or answer an agent's ask_operator question or a proven rule. This predates this PR; the route tests call the desktop router directly, which hid it. Fixed, and a new test walks every route the desktop router answers through IsDesktopPath.
  • The role's sweep instruction didn't work. "grep_files finds the sinks" led the agent to send a regex to a literal-match tool. Then shell_exec grep -E was refused because the pattern contained the denylisted token eval. The denylist is unchanged. The role now gives one grep -rnEi call and searches eval( with grep_files, and a test runs the role's command through ShellAllowed.

Tests and benches

  • Unit tests. team_board_tests TestFindings covers the snapshot, receipt, proof pair, wording, notices, once-per-cause and an operator-filed finding. teams_tests covers the roster, tier, kickoff, template, the sweep command and the denylist. desktop_routes_tests covers a finding over HTTP and that every route is reachable.
  • Revert-checks. Each behaviour was undone one at a time and the suite run to see it fail: 25 of 25 caught, including the bench's own.
  • make bench-teamboard now replays two recorded runs:
    • The existing duo run: 29 answers, sub-second handoffs. Request bytes rose 947,030 → 951,641 (+0.49%) from the longer task/rule schema text.
    • The new security-notes.json: 39 answers in 5.2 s, replayed in recorded order across agents. It checks that the board is done, the app's tests pass and three proven rules are waiting. If a recorded wake never comes it stops with STALLED after 45 s instead of hanging.
  • make test passes on FPC 3.2.2. Not compiled with Delphi (dcc64 is not available in this environment).

Docs: docs/teams.md (template table, a Security section, Findings, Needs-you routing note), docs/team-board-plan.md, docs/desktop.md, docs/security.md, docs/agent-bench-plan.md, bench/teamboard/LIVE.md.


Generated by Claude Code

… shut

A new team member that sweeps an app for security holes and fixes the
security architecture, plus the board support that makes a fix stick.

Role (ROLE_SECURITY): follows untrusted input from where it enters to
where it is used (SQL, shell, eval, paths, HTML, fetched URLs,
deserializers), then secrets, access checks, unsafe defaults and crypto.
A finding is a hole it demonstrated; each is filed as one task with the
attack as its criteria and its kind as the cause. It fixes the kind at
the boundary (one data layer that parameterizes, one escaping helper,
secrets from the environment) and submits with the attack before and
after.

Findings on the board: task create takes "cause" (the desktop's POST
too). The board keeps the project as the finding was filed, outside the
workspace like a submission's snapshot. A rule for that cause is then
proven against the defect itself and the accepted fix, so one fixed
hole is enough, where a reject cause needs two rejects. When a finding
is accepted, whoever filed it (or the leads, for the operator's) is told
to draft the check, once per cause.

Templates: sec joins software-team on the default tier, and the kickoff
hands it a sweep that waits on the build. A new "security" template
(Foreman + Security Engineer) sweeps a project that already exists.

Tests: team_board_tests TestFindings, teams_tests (roster, tier,
kickoff, template), desktop_routes_tests (finding over HTTP). Each
behaviour was revert-checked: 20 of 20 caught. Replay bench: 29 calls,
handoffs under a second, request bytes 947,030 -> 951,641 (+0.49%, the
longer task and rule schema text).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
… a replay

The security team (Foreman + Security Engineer) was run live through the
relay against a seeded notes app with three real holes. It found,
demonstrated, fixed and verified all three. Three checks were proven on
the first draft against the app as each finding was filed, and each
then caught a new instance of its kind elsewhere in the app.
bench/teamboard/LIVE.md, run 4.

Fixed from the run:
- The role said grep_files "finds the sinks"; it matches one literal
  string, and the agent sent it a regex. Then shell grep -E was refused
  for the word eval in its pattern. The role now gives the one
  grep -rnEi call that works and searches eval( with grep_files; a test
  runs the role's command through ShellAllowed. The denylist is unchanged.
- /v1/decisions and /v1/needs-you were 404 in a running gateway:
  IsDesktopPath never listed them, and the route tests call the desktop
  router directly. The desktop's Needs you could not show or answer an
  agent's question or a proven rule. Added, with a test that walks every
  route the router answers through that list.
- rule list shows each cause's findings; the desktop's board rows show
  "(finding: <kind>)".

Bench: make bench-teamboard replays both runs. security-notes.json
carries the seeded app and replays in recorded order (a check can only
be proven after the fix is accepted). It checks that the board is done,
the app's tests pass and three proven rules are waiting. It stops with
STALLED when a recorded wake never comes: with the finding proof undone
it stops at answer 38. Revert-checks: 25 of 25 caught.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T06:23:05.329113Z 06e1f8b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@FMXExpress
FMXExpress merged commit 1aabbdd into main Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants