Skip to content

docs(spec): admin_action audit events (Spec 133) - #2033

Merged
Dumbris merged 27 commits into
mainfrom
133-admin-action-audit
Nov 25, 2026
Merged

Dumbris merged 27 commits into
mainfrom
133-admin-action-audit

Conversation

@Dumbris

@Dumbris Dumbris commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Phase two of #1698: a spec, with no implementation, for a fourth audit-log event kind, admin_action. Each line records who changed the rules, on the synchronous audit JSONL stream that log shippers read. Phase one (#1842) put the caller on activity rows. This spec lifts that record onto the audit file.

Files under specs/133-admin-action-audit/:

  • spec.md: user stories in the reporter's priority order (tokens, then approvals, then config), FR-001–FR-023, and assumptions A1–A6.
  • contracts/admin-action-line.md: the line key by key, the full action list mapped to its doors and branches, the exemptions, the caller rules, and how values are redacted.
  • inventory.md: every administrative write door and what it records today, with file:line evidence. It includes the gaps phase one left, such as token hard delete, tool approvals with no actor, keyring secrets, POST /config/apply, file-watcher reloads and the server-edition handlers.
  • plan.md: design, the PR slicing (PR-1 to PR-5, each mergeable alone), the tests that pin each door, and five deferred design items, each settled in the PR that implements it.
  • research.md: decisions D1–D9 and the alternatives each one beat.

Decisions

  • Schema: an additive change within schema_version: 1, following the published versioning rule. A shipper filtering on schema_version == 1 keeps working. A validator holding a cached copy of the v1 schema rejects admin_action lines, because event and caller.kind are closed enums. The spec makes the docs say so.
  • Caller: the audit file's existing caller object, built the same way as on authz lines. The feat(activity): name the caller on config, quarantine and token-rotation rows #1842 keys map onto it. The caller-asserted surface goes to client.surface. A change with no caller is recorded as caller.kind: none, or as internal when the proxy itself decided, and carries a closed trigger.
  • What a line records: one committed effect, not one HTTP response. A partial failure records what persisted.
  • Values: field names always. Values appear verbatim only for booleans, closed enums, bounded numbers and name lists. Everything else is withheld, with no hash. Secrets, token values and key material never appear.
  • Failure: a failed audit write never refuses the change.
  • Readers: no new read surface. Scoped tokens can read nothing new.
  • Editions: the line is edition-neutral and is written whenever audit_log is on. There is no shipping connector; Kubernetes and Loki remain server-edition roadmap work.
  • Guard rail: a door-registry test, built from the live routers, the MCP dispatch tables and the CLI command tree, fails CI when a new write door lands without a record or an exemption.

Review status

The spec was cross-reviewed with opencode github-copilot/gpt-6.2-sol (variant high), two chunks per round, for 20 rounds (the maintainer raised the cap to 20). No round returned a clean verdict. I checked every finding against the code before applying it. Rounds 1–20 are applied. Round 20's eight findings were applied after the cap and are not re-reviewed (the last push is UNREVIEWED): a scanner_pull policy value for a scanner re-enabled by a late pull, and no scanner.disable for an unsaved enablement lost at restart; /token_prefix (active) plus /pending_token_prefix on a client.key_revoke during a staged rotation; scan settlement written at its effect boundary on either side of the 202 (contract and research D3); login.cancel for an approved code consumed by a failed exchange; an explicit exemption for discovery's removal of an absent tool's approval; PR-2 attribution for prompt/skill refreshes triggered by servers.changed and onSkillsConfigChanged, not only the reload; and review approve's unquarantined branch mapped to tool.approve. Merged on the maintainer's decision without a clean verdict; none of the 20 rounds raised a P1.

Test plan

  • Spec only: no code change, and CLAUDE.md is unchanged.
  • git diff --stat origin/main touches only specs/133-admin-action-audit/.

refs #1698

🤖 Generated with Claude Code

Related #1698

Phase two of #1698: a fourth audit-log event kind recording who changed
the rules (tokens, approvals, config), with the door inventory, the line
contract, decisions and the PR slicing.
Related #1698

Unit of record is the committed effect; values are typed literals or
withheld with no hash; caller from the request context incl. stdio;
proxy-side request id carried into MCP and Connect mutations; registry
built from the constructed routers, MCP tools and Cobra tree; hook
points on the commit result; per-branch action map and exemptions.
Related #1698

Scoped no-secret guarantee (values structural, labels pattern-masked);
no approval hashes or listen host; transport_request_id dropped;
in-memory decisions and multi-step Connect/review effects defined;
reject exempt; CLI ownership; registry classifies every route and reads
MCP dispatch descriptors; published schema stays tolerant.
Related #1698

Binding hook rules (backend result, compensation, ingress vs decider,
bookkeeping, one owner); audit-file lock for CLI ownership; schema
constraints only under admin_action; strict enum literals; OAuth outer
mux doors, baselines, repins, restart adoption, bundle transitions;
commit result moves to PR-1; inventory rows folded.
Related #1698

Daemon detection by instance lock, file writes by a separate lock;
request-id precedence (reuse, mint only at bare ingress); keyring late
completion; embedded-only bundle digest; exact review line set; Connect
steps and client-file exemption; compensation counting; ingress tagging
moves to PR-1; schema validated on sink output.
Related #1698

Instance lock held across CLI read-modify-write and taken by serve
before config; fixed field paths and withheld derived registry ids;
keyring owned by the backend completion path; short-write recovery on
reopen; list diffs; SSO and registration caller overrides; ordered
bundle application; login.cancel; watcher vs desired disk state.
Related #1698

Ownership by resource (canonical config-path lock; keyring recorded by
its writer); three separate counts; JSON Pointer field paths; persisted
registry id origin; email emitted only when valid; login.cancel on
browser-login switch-off; per-leg bundle transitions with commit
sequence; REST dispatch descriptors; GET effect classes; inventory rows.
Related #1698

Owner record with endpoint and instance nonce, one resolved path for
lock/load/save/watch, all config-writing CLI branches enforced in PR-1;
canonical audit path; records read back from the file, torn tails
repaired before rotation; pointer capping before escaping; approval as
store transition; key-only vs client-wide revoke; jwt.issue scope;
login.cancel delivery in PR-1; bundle refresh reads last applied
policy; watcher same-bytes raw baseline; outer mux registrar.
Related #1698

Contract keeps CLI ownership, commit stages, sink boundaries, bundle
commit points and cancellation capture as requirements; mechanisms move
to deferred design items D-A..D-E settled and reviewed in their PRs.
Wire fixes: login target split ids, derived labels withheld with ref,
single caller precedence, login.cancel branches, tool.hold, config
delta partition, PATCH /servers in PR-1.
Related #1698

Authorization-only login targets for denials; derived-label rule
narrowed to URL- and DCR-derived ids, ref lifecycle and caller alias;
internal only via explicit decider; profile selector exempt; admission
quarantine of existing servers; scan settlement attribution; legacy
key-only revoke and offline reconcile; offline abandonment loss class;
per-effect registry status; descriptor move keeps the switch guard.
Related #1698

Import-derived server names withheld with ref; admin_action agent
caller shapes for a withheld token name; offline reconcile caller;
scan-settlement attribution by job; profile rename/delete and
anonymous_profile targets; stdio registry; admission wording aligned.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 57cdc74
Status: ✅  Deploy successful!
Preview URL: https://48cdeb3c.mcpproxy-docs.pages.dev
Branch Preview URL: https://133-admin-action-audit.mcpproxy-docs.pages.dev

View logs

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: 133-admin-action-audit

Available Artifacts

  • archive-darwin-amd64 (33 MB)
  • archive-darwin-arm64 (30 MB)
  • archive-linux-amd64 (21 MB)
  • archive-linux-arm64 (19 MB)
  • archive-windows-amd64 (33 MB)
  • archive-windows-arm64 (29 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (29 MB)
  • installer-dmg-darwin-arm64 (27 MB)
  • smart-mcp-proxymcpproxy-goTRK5GT.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 45655754083 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Derived server and client labels withheld from PR-1 (recomputed server-name
check, client origin keyed by client id), agent-token ref, profile-name
scalar literal and exact rename/delete shapes, quarantine_not_enforced
policy, zero-tool review line set, prompt/skill holds, scanner enable
semantics, user.disable session revocation, PUT /profiles/active unhooked.
Sticky persisted server-name origin (legacy withheld, A7/Q5) applied to
every server reference incl. server-edition targets; name lists render only
resolved entries; profile-name sides validated per snapshot and whole-config
delete-plus-clear unfolded; user.sessions_revoke and exact disable retry
sets; scanner first-configure folds enablement; gate-origin marker in PR-1;
request-id assertions split for masked ids; inventory MCP restart/refresh.
Whole-entry withholding for an unresolvable profile-name side; server refs
keyed by identity and always emitted; private-key block labels withheld;
secret names containing a withheld server name withheld; first effective
binding; restart adoption attributed to the edit; unquarantine promotion
batch; 409-after-commit test; prompt.hold assigned to PR-2.
Keyring names always withheld by ref; withheld-client login shape;
explicit-false quarantine decision; restart adoption admission line and
observed-edit request-id exception (FR-009/FR-013a); /user/servers caller by
role; admission origin from every gate.
@Dumbris
Dumbris enabled auto-merge (squash) November 25, 2026 16:37
@Dumbris
Dumbris merged commit 6f7b308 into main Nov 25, 2026
87 of 89 checks passed
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