Skip to main content
All research

Permissions that only shrink

A queued agent run keeps the authority it was accepted with, minus anything revoked since. It never gains access granted while it waited.

An agent run doesn’t always start the moment someone asks for it. It can wait in a queue behind other work, or pause halfway to ask the user a question and pick up again minutes later. Either way, there is a gap between the moment a request is accepted and the moment it actually runs.

Authority can change during that gap. An administrator revokes a capability. An employee connects their Salesforce account. A conversation is closed. The remote server behind an integration adds a new tool. This essay is about how Summa decides which version of the world a waiting run gets, and why the answer is neither the old one nor the new one.

Two obvious answers, both wrong

Take a concrete case. At 09:00 an employee asks for a summary of their open opportunities, and the request joins the queue. At 09:02 an administrator removes CRM access from their access profile. At 09:03 the run starts.

If the run uses the authority it had at acceptance, it queries Salesforce on behalf of someone who no longer has access. The revocation arrives too late for exactly the work it was meant to stop.

Now flip it. At 09:00 the employee writes a message in a conversation where CRM access isn’t yet available. At 09:02 someone grants it, or the employee links their account. If the run uses the authority it has at execution, it can now reach a system the sender never had access to when they wrote the request. Nobody decided that this request should touch the CRM. It just happened to run after the grant.

Neither moment is safe on its own. The first keeps authority that was taken away. The second hands out authority nobody gave to this request.

Snapshot at acceptance, intersect at execution

The rule we use is: record what the run was allowed when it was accepted, read what is allowed now when it executes, and keep only what appears in both. A queued run can lose authority. It can never gain any.

When a message is accepted, the run row gets a policy_snapshot. It holds the sender’s product access (accepted_access), the live integrations available to them (accepted_integrations), the conversation’s data policy, the authorisation grants, and — when a dynamic integration is involved — the exact remote tools that existed then. Immediate runs record it too, because a run that pauses on a question has the same gap.

The executor then does the intersection before it builds the tool environment:

current_access = await load_effective_access_policy(db, tenant=tenant, user=user)
effective_access = (
    current_access.intersect(spec.accepted_access)
    if spec.accepted_access is not None
    else current_access
)
current_integrations = await resolve_available_integrations(db, tenant=tenant, user=user)
effective_integrations = current_integrations.intersect(spec.accepted_integrations)

For integrations the operation is a plain set intersection: IntegrationSnapshot(available=self.available & other.available). “Available” is a strong word here. It means the whole chain holds — workspace connector policy, the person’s access-profile entitlement, an active tenant registration and their own linked account in good standing. Holding a valid OAuth token is deliberately not enough. An employee whose entitlement was withdrawn still has a working token, and, as the code puts it, “a hidden button has never been an access control.”

Access intersection keeps a detail that matters for anyone debugging later. The surviving decisions are the current ones, so an administrator who asks why a run behaved as it did is told about the policy in force, not a stale copy. A capability that is permitted now but wasn’t at acceptance is recorded as not granted: “the run was accepted without it and may not pick it up while it waited.”

Whatever doesn’t survive the intersection isn’t refused at call time. It is never in the environment, so the model is never shown a tool it would be denied. The default fails closed too: an empty integration snapshot excludes every integration-backed capability, so forgetting to pass availability exposes nothing.

The data policy travels with the run

Some limits are about the conversation, not the person. A temporary chat has bounded retention and no history. Memory is removed from its environment entirely, and connector writes never reach the run. Those rules live in one policy object, and it is snapshotted with the run. The code’s reasoning: a feature flag flipped, an admin control changed, or Memory switched on afterwards must never make a waiting turn more permissive than the moment it was asked for. Only the mode, the flags and the expiry deadline go into the snapshot, never content.

This one is pinned rather than intersected, and the reason is structural. A conversation’s retention mode can’t change after creation, so there is nothing newer to intersect with. What can change is whether the chat is still alive. The executor checks that just before starting: a temporary chat that was closed or has expired while the run waited is retired without a single model call or tool execution. A snapshot that declares itself temporary but is malformed fails closed — its expiry is set to the earliest possible date rather than left open.

Catalogues that change without a release

Our Salesforce integration talks to Salesforce’s hosted, read-only platform/sobject-reads MCP server. That brings in a kind of authority the access snapshot doesn’t cover. The list of tools comes from the remote server, and Salesforce can change it at any moment without a Summa release.

The trust boundary is a server profile, written in source code and reviewed like any other security assumption. Its docstring states the design in two lines:

a remote server decides what tools exist; only a Summa release can decide what authority they receive.

Every admitted tool gets its ceiling from the profile — a read effect and the salesforce.read grant — so nothing the remote says can raise it. On top of that, the queue guarantee is applied to the catalogue itself. At acceptance, each dynamic capability records a set of (local name, schema hash) pairs. At execution the tools are resolved again, and only those matching both name and hash are kept.

The hash covers the tool’s contract: input schema, output schema and annotations. It deliberately excludes the prose description, which Salesforce may reword without the tool meaning anything different. So a tool whose schema changed after acceptance doesn’t match. The code treats it as a different tool, because “treating a changed tool as the old one would validate arguments against a contract neither the sender nor the model ever saw.” A tool added while the run waited isn’t in the snapshot, so it doesn’t appear.

Two fail-closed details complete the design. If the remote is unreachable at acceptance, that capability is pinned to an empty set, so a lucky recovery before dispatch can’t turn an outage into extra tools. And if pinning leaves a dynamic capability with no tools at all, the capability is removed along with its prompt module, because a CRM prompt next to zero CRM tools teaches the model to reach for something that isn’t there.

Quarantine one tool, reject the whole catalogue

Before any of this, every remote tool passes admission. Names and schemas must be well formed and within the profile’s size limits, and descriptions are stripped of control characters. Two checks are about authority, and they behave differently on purpose.

The first concerns annotations. MCP lets a server mark a tool with hints such as readOnlyHint and destructiveHint. On a profile whose ceiling is read-only, a tool that claims readOnlyHint: false or destructiveHint: true contradicts the reason the profile was trusted at all. That tool is quarantined: it is logged and skipped, not reclassified. Every other tool in the catalogue is admitted as usual. A missing hint is fine, since hints are optional. Only an explicit claim of write capability counts as a breach.

The second concerns size. The Salesforce profile reviews a bound of 100 tools. A catalogue that advertises more is rejected whole, with an error naming the count and “the reviewed bound”. That error surfaces as a provider failure, so the CRM capability exposes nothing for that run.

The asymmetry is the point. One unusual tool shouldn’t take a useful integration down. Unbounded growth is a different signal: the endpoint no longer matches what was reviewed, and the right response is to stop and look.

What it costs

  • A new grant doesn’t help a waiting request. If you connect Salesforce while your question is queued, that question still runs without it. You send it again.
  • Remote changes can quietly remove capability. If Salesforce changes a tool’s schema while a run waits, the run loses that tool. If every tool changed, the whole CRM capability is gone for that run. The answer is weaker, but nothing ran under a contract nobody saw.
  • Outages are sticky. A remote failure at acceptance leaves that run with an empty catalogue even if the remote recovers before it executes.
  • Growth needs a release. If the remote catalogue grows past the reviewed bound, the integration stops working until someone reviews it and ships a new bound. That is intended, and still a cost.
  • It is a gate, not a live wire. The intersection happens when the run is dispatched. It doesn’t interrupt a tool call that is already running. Salesforce keeps enforcing its own object permissions, field-level security and record sharing on every call, so Summa never has more reach than the employee — but the queue guarantee itself is checked when the run starts.
  • Old runs are a special case. A run accepted before access snapshots existed has nothing to intersect with, so it uses current access. Inventing an empty snapshot would have stripped every run already in flight of its tools.

What we would generalise

  • Authority belongs to the request, not to the worker. Record what was allowed when the request was made, and treat everything later as able to narrow it, never widen it.
  • Intersection is the only safe combination. Union, “latest wins” and “first wins” all fail in one direction. Only intersection guarantees a waiting job can lose access and never gain it.
  • Hash the contract, not the prose. If a tool definition you didn’t write can change, pin what affects authority — schemas and annotations — and treat any change there as a new tool.
  • Let the remote describe, never authorise. Discovering tools dynamically is useful. Their ceiling should still come from something you reviewed and shipped.
  • Quarantine the anomaly, reject the drift. Fail one tool when one tool is odd. Fail the whole integration when the integration no longer looks like the thing you approved.