Skip to content

feat(plugins): tole plugin audit, a read-only report of locked plugins and pinned skills (#600) - #882

Merged
ajianaz merged 5 commits into
developfrom
feat/600-plugin-audit
Nov 17, 2026
Merged

ajianaz merged 5 commits into
developfrom
feat/600-plugin-audit

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What

Slice 3b of #600, building on #880: tole plugin audit [NAME] [--json], one read-only report of every MCP server in the plugin lock and every discovered skill.

Why

The design (third-party-plugins 4.5) promises an audit that shows tier, hashes, grants and recent events in one place. Until now the owner had to combine plugin list, plugin diff, the ledger file and skills list by hand, and the sandbox fallbacks of #876 were only in the ledger. Follow-ups: the uteke registry fetch is #878, ledger gaps are #879.

Changes

  • Per MCP server: tier, state, approved against live manifest hash, binary integrity, secret grants, sandbox profile approved and in force (with the CHANGED flag), scanner findings, and the last three sandbox_fallback events of the plugin ledger.
  • Scanner input is the live tool list when the server was started, otherwise the approval's stored snapshot.
  • Per skill: status (approved, approved but unrecorded in the skill ledger, changed since approval, refused by the ledger, not approved, unreadable), hash on disk against the approved hash, the stated source, and the last three skill-ledger lines.
  • Output rules:
    • Writes nothing.
    • Starts a server exactly as list does: never one the lock refuses, never under an agent session, each at most once.
    • Prints no tool text beyond scanner findings, so no more than plugin diff shows.
    • Every string is redacted, terminal-safe and forced onto one line, so a name from a hand-edited lock cannot forge a report line.
    • Hashes are cut at a character boundary (a non-ASCII hash from a hand-edited file no longer panics short()), and ledger-derived profile and reason are capped at 300 characters.
  • list is split into collect and render_list so both commands share the row data; behaviour-preserving (the existing list tests pass unchanged), and probe_state now wraps a new probe_listed that also returns the live tool list.
  • Impact by grep: short, trusted_tier, binary_note and Ctx::clean become pub(super) inside the plugin module only; PluginAction::Audit has no other match site; skill_approve::audit_rows is new and only called by audit. No published pub item changes signature.
  • Docs: README command list, CHANGELOG, epics and a design section.

Testing

  • Fail-first (neuter, see fail, restore): disabling redaction in the audit fails audit_reports_hashes_findings_and_the_last_fallbacks_without_writing; a newline in a lock key forging a report line failed audit_is_terminal_safe_for_names_from_the_lock before the one-line rule was added; restoring the byte slice in short() fails audit_survives_non_ascii_hashes_and_caps_ledger_text with a char-boundary panic.
  • Also covered: the audit leaves the lock and ledger byte-identical, starts nothing under a session or for a revoked server (the lister panics if called), an unknown name is an error, the last three of four fallbacks are shown, and the skill statuses including unrecorded.
  • Real-binary e2e in skill_approval_e2e (audit calls gated on the mcp feature) checks the pinned skill appears with its source and that a swapped SKILL.md shows as changed.
  • fmt, clippy -D warnings (workspace all features; core, cli and tui --no-default-features; cli shell-tools-only), cargo check -p tole-core --no-default-features --tests, and TOLE_REQUIRE_BWRAP=1 cargo test --no-fail-fast in default (2658 passed), --no-default-features (2015) and shell-tools-only (1129): all green on the merged head. CI: all 19 checks green and Cora Review "No issues found" on the final head.
  • A pre-PR independent agent review reported NO BLOCKER and ran the plugin:: lib tests (80/80), skill_approval_e2e (3/3) and the no-default-features checks.
  • cora is not installed here; the CI Cora review is the gate. The attribution grep over the branch commits prints nothing.

Refs #600

…nd-only ledger

tole skills approve takes --source-url, --registry-id and --pinned-sha,
recorded as data only. Skill approve, revoke and draft promotion are
appended to skill-ledger.jsonl before the approvals file; an approval the
ledger contradicts is ignored at load, unrecorded approvals are reported
once, an unreadable ledger fails startup, and a torn tail is repaired.
tole skills revoke and tole skills drafts revoke are owner-only.

Refs #600
…s and skills

Per MCP server: tier, state, approved against live manifest hash, grants,
sandbox profile, scanner findings and the last sandbox_fallback ledger
events. Per skill: status, approved hash against disk, stated source and
ledger lines. Starts only what list would start, never under a session.

Refs #600
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 99dca90 into develop Nov 17, 2026
23 checks passed
@ajianaz
ajianaz deleted the feat/600-plugin-audit branch November 20, 2026 08:35
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