Enforcing client ceilings and recording tool calls
The daemon already carries a principal in request context and records authorization decisions for declared operations. At revision 1f9bc15391ca, the operation authorizer answers yes. The route wrapper calls it when the principal exists and then invokes the handler. A pattern without an operation-table row registers the handler directly. Existing bearer checks, write controls, rate limits and harness permission hooks have distinct purposes. Implementing per-client ceilings requires a decision that can prevent dispatch for every relevant entry point. Inventory all operation patterns, dynamic tool calls, code execution, background work, adapters and proxy entry points first. Each must either reach the decision point or have an explicit, testable public or internal classification. Authorizer · Route wrapper
Identity, delegation and compatibility
Bind the principal to a verified transport identity or a credential issued for this gateway. Unix peer identity identifies an OS account and does not automatically distinguish two agents running under that account. Keep harness, seat, session and downstream audience separate. A client-supplied session label can correlate requests but cannot widen a grant. The accepted elicitation decision binds the operation to the owner and original request. A future multi-principal elicitation path requires a superseding decision, authenticated presenter, nonce, expiry and replay rejection. Until then refuse a claimed identity change and preserve the owner-bound path. Elicitation decision 0007
Start with an operator-owned policy keyed by trusted identity or verified issuer/subject. Resolve a versioned snapshot. Include namespace and tool allowlists, operation modes, sensitivity ceiling, corpus grants, rate, concurrent calls, token/resource budget, and revocation epoch where applicable. Server manifests may describe operations. A manifest or unverified tool annotation must never grant itself new permissions. A delegated grant can only narrow the parent grant. Intersect the user’s grant, client ceiling, requested operation, server constraints and remaining budget. Make restrictive outcomes explicit when required metadata is absent. Preserve existing deployments through a documented owner-equivalent migration profile. Introducing an unidentified remote caller must not silently select that profile.
Apply the same effective grant to catalog, search, types and execution. In particular filter the candidate catalog before scoring and recheck the selected target immediately before invoking it. Bind a decision to the resolved server generation and tool identity so a reload or alias change cannot redirect a previously authorized operation. At enqueue record the requested operation and principal; at dequeue recheck expiry, revocation and current policy before upstream I/O. Reserve budgets before concurrent dispatch and release or settle once. After a lost reply, record an unknown outcome and reconcile rather than retrying a side effect automatically. Enforcement in Atlas remains necessary because MCPX cannot filter hidden rows correctly after upstream ranking. Atlas acceptance · ID capability evaluator
Audit and feedback
Assign a logical call ID before policy evaluation and an attempt ID per downstream attempt. Persist the minimal decision record with trusted principal reference, operation, canonical target identity, policy revision, server generation, decision and reason, timestamp, attempt outcome, elapsed time, sent/received byte counts and accounting status. Use monotonically measured durations; record unknown counters as unknown. Denied-before-dispatch has zero upstream attempts. An interruption after sending a write can have one attempt and an unknown outcome. Keep a durable start/decision association where attribution is required; a crash reconciler can classify incomplete attempts without inventing success. Configure retention and restrict access per record class. Availability versus fail-closed behavior during audit storage failure requires an explicit policy and a test.
The interaction store has a different purpose. At the pinned revision it records raw interaction material on some call paths, and feedback actually influences semantic ranking. Existing direct-call capture stores server:tool, proxy capture assigns the offered tool list to ToolsUsed, and semantic ranking passes a generated function identity to a SQL lookup using substring matching. A tool offered to a model is not evidence that the model used it. Define separate fields for offered, requested and executed tools. Resolve them to an exact stable ID, with server-generation provenance and source spelling retained for migration. Use structured equality for scoring. When a legacy identity is ambiguous, leave its historical feedback visible to its owner but exclude it from updates to a different tool. Preserve existing history without copying raw queries or responses into the new decision stream. Direct capture · Proxy capture · Ranking · Store lookup
Use this one metadata stream for per-server call counts, refusals by reason, latency distributions and the live dashboard. Distinguish distinct calls, attempt counts and active clients in aggregates. Scope feedback access and statistics by the viewer’s grant and suppress cross-client data when necessary. Keep raw payload capture independently controlled, with explicit retention, access and deletion semantics. Restrict telemetry payload fields at the producer and serialize an allowlisted projection. Log redaction after ingestion cannot provide this guarantee.
Model, prompt and administrative operations
Model resolution already supports ordered profiles and per-attempt timeout/budget handling. Apply one shared operation budget across profile candidates, repair and hooks. Distinguish missing configuration, transient provider failure, payment refusal and uncertain result after a partial stream. The fleet requires HTTP 402 to stop this generation before another provider is called. The public outcome should identify the reason without including provider response bodies. Preserve existing success and 503 handling when introducing this narrow fix. Prompt hooks already support advisory and proposed changes. Keep generated scripts and proposed outcomes reviewable. A natural-language request for administration must map to a declared operation, validated arguments and the same authorizer used by direct calls. Human confirmation binds to the exact operation and snapshot. Model profiles · Hook proposal semantics · Administration by intent
Verification sequence
| Fixture | Required observation |
|---|---|
| Narrow and wide grants through two different transports | Same rights give the same decision. Spoofing a harness label leaves rights unchanged. A disallowed call makes zero upstream requests. |
| Queued task followed by grant revocation | Claim can still complete its bookkeeping. Dispatch is refused before an upstream write. The rejection links to the original logical call. |
| Declared tool replaced during reload | A stale tool or generation is revalidated before I/O. An unrelated server remains available. |
| Wide Atlas query followed by an identical restricted query | Restricted results cannot disclose excluded data or reuse an ineligible cached result. Correlated records identify both policy decisions. |
| Tools with adjacent names and one positive direct-call rating | Only the rated identity’s feedback multiplier changes. Merely offering either tool produces no execution signal. |
| HTTP 402 plus a second loopback provider | One request reaches the refusing provider and zero reach its successor. A separate 503 fixture continues to demonstrate the declared retry behavior. |
| Cancelled or disconnected write | Audit reports attempt count and unknown or reconciled outcome. Dashboard statistics never report a guessed success or a second execution. |
These are release criteria. The checked source establishes the existing behavior and reference points, without supplying runtime receipts for the proposed controls.