Skip to content

feat(security): use the vetted Vulnogram operations under the secure setup - #2182

Merged
potiuk merged 2 commits into
apache:mainfrom
potiuk:feat/security-skills-vetted-cve-ops
Nov 18, 2026
Merged

potiuk merged 2 commits into
apache:mainfrom
potiuk:feat/security-skills-vetted-cve-ops

Conversation

@potiuk

@potiuk potiuk commented Nov 18, 2026

Copy link
Copy Markdown
Member

Summary

#2133 added vetted operations that run the shipped Vulnogram client outside the sandbox with a fixed argv: cve-allocate, cve-record-update and cve-record-fetch (granted in the [callers] example by #2164).
The skills still allocated and pushed records through cve-tool, which passes every adapter flag through (--allow-state-downgrade, --credentials, …).
This is #2133's second follow-up: under the secure setup the skills now use the vetted operations where they can.

  • Allocation (security-cve-allocate, Step 3). cve-allocate recipe takes an optional vetted_workspace.
    With it, the API path's command is vetted-op --caller security-cve-allocate cve-allocate <pmc> <workspace>/cve-title-<hash>.txt, and a new title_file output gives the path and text to write first (the name is a hash of tracker, issue and the approved title, so no other run — another tracker, or the same issue with another title — writes the same file before the allocation reads it).
    The reporter-influenced title travels as a file, never quoted into a command line.
    Without vetted_workspace nothing changes.

  • Record push (security-issue-sync, Step 5b). The push uses vetted-op --caller security-issue-sync cve-record-update, with the JSON in the workspace.

  • What stays on cve-tool. The vetted push refuses these by design, so they keep cve-tool push:

    • a push whose JSON moves a record to PUBLIC from another state;
    • the two confirmed overrides (--replace-references, --allow-product-change).

    fetch, check, setup and publish have no vetted operation and stay as they are.
    A REVIEW → DRAFT walk-back needs no override (the client only refuses a downgrade from PUBLIC), so the vetted push covers it.

  • Exit codes. A failed vetted call exits 4 and names the client's code on stderr (CVE tool exit N); the skills read the existing exit tables with that N.
    Only a refusal naming a missing grant (is not permitted to run) falls back to cve-tool. Any other vetted-op refusal (a rejected record, a malformed PMC) stops, so the vetted checks are never routed around.
    Any other allocation outcome (an interrupted run) is treated as unclear and sends the user to the PMC's records first, so an allocation is never sent twice; a push simply re-runs, since it is idempotent.

  • vetted-op cve-allocate gains a pmc parameter (lowercase, validated), passed as --pmc, so the client refuses a token held for any other PMC.
    Without it the client used whatever PMC the current session held, and the Step 0 pre-flight could not guarantee that at allocation time.

Type of change

  • Skill change (plugins/magpie-security/skills/cve-allocate, issue-sync/apply-and-push.md) — eval suites run below
  • Python package (tools/security-management, tools/vetted-ops: the pmc parameter)
  • Other: spec tools/spec-loop/specs/cve-tooling.md gains the invariant

Test plan

  • vetted-ops: cve-allocate argv carries --pmc; malformed PMC values (Airflow, airflow --credentials, --credentials, ../x, empty) never reach the client
  • 5 new recipe tests (incl. no title-file collision between a-b/c, a/b-c, a/b, nor between two titles for one issue): the vetted command and title_file (a hostile title never reaches the command line), cve-tool kept without vetted_workspace, workspace ignored off the API path
  • security-management and vetted-ops test suites pass (vetted-ops: apart from the 6 sandbox-only setup errors fixed separately in the open fix/approved-policy-sandbox-skip PR)
  • Adversarial review (codex, copilot; antigravity timed out): three rounds; every finding is fixed in this PR: a fallback that could allocate twice, an unnamed PMC, a fallback that routed rejected records around the vetted checks, and title-file name collisions
  • Evals: security-cve-allocate 4/4, security-issue-sync/step-5b-judged-gates 2/2 (journaled, README tables regenerated)
  • prek run --all-files --skip workspace-pytest --skip spec-validate passes; measured_tokens restamped (cve-allocate 6470 → 6574)

RFC-AI-0004 compliance

  • HITL — both vetted operations are writes through vetted-op, so every allocation and push keeps its per-call confirmation; allocation still runs once, on an explicit yes
  • Sandbox — no new host access; the change narrows what a sandboxed agent can pass to the client

Linked issues

Refs #2133, #2164

Notes for reviewers (optional)

The design choices above (which operations move, which stay on cve-tool, the fallback on a non-client refusal) were made to keep every existing behaviour reachable.
Whether cve-tool should also stop passing the override flags through is a separate question, left for a follow-up.

🤖 Generated with Claude Code

@potiuk potiuk added family:security security-* skills capability:fix Implement code change to resolve an issue labels Nov 18, 2026
@potiuk
potiuk enabled auto-merge (squash) November 18, 2026 02:53
@github-actions github-actions Bot added family:tools tools/* family:docs Docs, MISSION.md, READMEs capability:intake Import external signal + sync tracker state capability:resolve Close-out: invalidate, dedupe, CVE allocate, announcement substrate:analytics Tool substrate: read-only metrics / dashboards / renderers substrate:sandbox Tool substrate: agent isolation, egress control, settings audit family:dev Repo dev: .asf.yaml, spec-loop specs, Node manifests, .claude/settings.json labels Nov 18, 2026
…setup

outside the sandbox with a fixed argv and no override flag. The skills
still allocated and pushed records through the generic tool interface,
which passes every adapter flag through.

Under the secure setup, with the operations granted, the allocation skill
now allocates through the vetted operation, with the title written to a
workspace file instead of quoted into a command, and the sync skill's
record push uses the vetted push. The recipe renderer returns that command
and the title file when given the workspace.

The generic interface stays for what the vetted push refuses by design (a
push that promotes a record to its final public state, and the two
confirmed overrides) and for fetch, check, setup and publish. A failed
vetted call names the client's exit code on stderr, so the existing exit
tables still apply; any other refusal means nothing ran, and the skill
falls back to the generic interface.

Generated-by: Claude Opus 5
Fixes from the pre-PR review of the previous commit:

- The vetted allocation names the PMC: the operation gains a validated
  pmc parameter, passed as --pmc, so the client refuses a token held for
  any other PMC instead of allocating for whatever the session holds.
- Only a refusal naming a missing grant falls back to the generic tool
  interface. Any other refusal (a rejected record, a malformed argument)
  stops, so the vetted checks are never routed around, and an unclear
  allocation outcome sends the user to the PMC's records first, so an
  allocation is never sent twice.
- The title file is named by a hash of tracker, issue and title, so no
  other run can replace the approved title before the allocation reads it.

Generated-by: Claude Opus 5
@potiuk
potiuk force-pushed the feat/security-skills-vetted-cve-ops branch from 21ea2cb to fbf1e1e Compare November 18, 2026 04:57
@potiuk
potiuk merged commit 2709def into apache:main Nov 18, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:fix Implement code change to resolve an issue capability:intake Import external signal + sync tracker state capability:resolve Close-out: invalidate, dedupe, CVE allocate, announcement family:dev Repo dev: .asf.yaml, spec-loop specs, Node manifests, .claude/settings.json family:docs Docs, MISSION.md, READMEs family:security security-* skills family:tools tools/* substrate:analytics Tool substrate: read-only metrics / dashboards / renderers substrate:sandbox Tool substrate: agent isolation, egress control, settings audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant