CURATION LABS · GATEWAY-CENTRIC WORKERS
Four designs for AI workers over the last eighteen months, from one session to one gateway, and the contract we still have to write.
Remy · Curation Labs · ~40 min, then discussion
OPEN
Everything the model sees on this one call — not everything it’s ever seen.
Everything today is this picture, zoomed. The model knows only what is in the input, this call.
Remy’s brief; report §11.1
OPEN
illustrative · every Monday, brief Alice on the Acme account and draft the update
use Slack, Linear and Gmail
run every Monday on its own
remember last Monday’s brief
stay inside Acme, act as Alice, and hold the email for approval
We’ll run this one task through four designs.
report §10.4, §10.5
ACT ONE · TWO IDEAS
Piled up
… overflowing
Built
One of the biggest challenges in building Pinecone was making sure it had access to the right context, which is the lifeblood of any great agent.
Sierra · Building Sierra’s MCP gateway (Pinecone is Sierra’s own internal agent, not the vector database)
Phase 3 is when we started building it on purpose.
report §12.2 slide 4; Sierra capture, intro paragraph; 034_2 §1
ACT ONE · TWO IDEAS
allowed?
policy · the gateway
useful now?
strategy · the runtime
one refund policy, four ways into the input
whole document
one-line skill
callable tool
two paragraphs
Keep the gates apart and you can change the second without touching the first.
report §12.2 slide 5; 034_2 §6, §28
ACT ONE · TWO IDEAS
89%of employees use it weekly
45services connected
SOURCE
Mihai Parparita · Sierra · 22 Jul 2026
Pinecone = Sierra’s internal agent, not the vector database
Model Context Protocol: the open, standard way an agent finds and calls a tool.
One service that sits between every agent and the outside world, deciding what it may reach and what comes back.
Instead, we built one gateway for everyone.
Every team could have built its own permission model. They built one.
Sierra · Building Sierra’s MCP Gateway: An engineering iceberg, Mihai Parparita, 22 Jul 2026 · report §8
ACT ONE · TWO IDEAS
who may
users vs. service accounts role-gated services OAuth 2.1 server dynamic client reg per-user credential grants optional scope groups serialized token refresh scoped read-only tokens out-of-band approval pre-authorized workflowswhich tools
tool block & replace proxied MCP servers REST extensions OpenAPI generic call composite connectors service owners self-service docs search-stack reuse cached tool listings lazy discovery tool-name prefixing read-only annotationsrun it
sidecar supervision readiness handshakes multi-region fan-out compatibility shims session persistence heartbeats & keepalives per-connector timeouts optimistic-lock retries rate-limit diplomacy kill switchesshape the result
customer tagging multi-tier classification data sensitivity levels cross-customer blocking summarize, don’t dump question sanitization draft-only sends resume false positives file refs, opaqueoperations
audit log + Slack feed MCP Inspector usage analytics living arch docOurs, not Sierra’s: the post never sorts its 45 items this way — full wording in the appendix.
A good part of a gateway decides what the agent gets to see.
Sierra · Building Sierra’s MCP gateway, figure 1 · report §8.2–8.3
ACT ONE · TWO IDEAS
Interactive work runs as the user.
Sierra · Building Sierra’s MCP gateway, Lesson 7
…we want all write or destructive operations to be tied to user intent and approval.
Sierra · Building Sierra’s MCP gateway, Lesson 6
An agent can't misuse what it never sees
Sierra · Building Sierra’s MCP gateway, Lesson 3
Keep these three in mind. Each one knocks down a wall later.
Sierra · Building Sierra’s MCP gateway, Lessons 3, 6, 7 · report §8.4
ACT TWO · FOUR DESIGNS
? what goes in?
? who says it may?
Each design moves one thing out of the session.
report §11.1–§11.3
ACT TWO · PHASE 1 · UNTIL JAN 2026
brief Alice, with her own keys
remember last Monday, or run without her
Three walls: it forgets, it’s built by hand, and it runs on Alice’s keys.
report §7.1 (cc-architectures)
LENS 1 · PHASE 1
The model’s entire input for one call, with a hard size limit measured in tokens — the model’s own units of text.
And it all goes when the session does.
report §11.5; Flue compaction, §7.2
ACT TWO · PHASE 2 · FEB–JUL 2026
The program that drives the loop and calls the model. Codex, Claude Code and Mastra are three we run today.
One wall down. Every run still starts blank.
report §7.1 (containerized-cli-harness)
ACT TWO · PHASE 2 · FEB–JUL 2026
run every Monday on its own
remember, scope the key, or limit what it touches
Every team could have built its own integrations, permission model, and auditing system…
Sierra
Every run starts blank, every worker shares one key, and nobody decides what it may touch.
report §7.1 (@cch/coordination)
ACT TWO · PHASE 3 · FROM JUL 2026
An open-source agent framework that re-runs our agent function before every model call.
A Cloudflare primitive: one conversation's own persistent, single-threaded worker.
It remembers now, and the org has a catalog. But every worker shows the same key, and nobody records whom it acts for.
report §7.2a (worker-rooms-2); we first rejected Flue, then adopted it once a spike ran end to end
LENS 2 · PHASE 3
export function useMemoryIndex(
seed: WorkerSessionSeed | undefined,
enabled: boolean,
call: SpacesCall = spacesCall,
): void {
const delivery = useDelivery();
useAgentStart(async (ctx) => {
if (!enabled) return;
const signal = await memoryIndexIntake(
seed,
delivery as { kind?: string; type?: string; attributes?: unknown },
call,
);
if (signal) ctx.append(signal);
});
}
One execution of the agent function, re-run before every model call.
Persistent state is its input. The model sees only what it returns.
worker-rooms-2/apps/worker-runtime/src/runtime/memory-index.ts:175–190 · worker-rooms-2, report §7.2a; Flue re-renders before every model call, docs/reference/agent-api.md:33
ACT TWO · PHASE 3 · FROM JUL 2026
recall last Monday, open Acme’s files, use the org catalog
prove who is calling, or hold an email for approval
Phase 3 knows what it knows. It still can’t say who is asking, or for whom.
report §10.5; §7.2a (042)
ACT TWO · RECAP
Nothing moves out yet.
The kit moves into a container.
Memory and state move onto durable storage.
Authority moves into the gateway.
What’s left inside the worker is its authority.
report §10.3; phase windows per Remy per report §10.8
ACT TWO · PHASE 4 · NOW, IN CONSTRUCTION
A key that proves who — or what — is allowed to act. Never called a “token” here.
The credential never enters the input. It rides with the call and stops at the gateway.
report §7.3 (model-tools.ts:66; org-custody-do.ts)
LENS 4 · PHASE 4
organization ceiling
GmailAlice’s permissions
repo YAlice’s grant to her worker
Interactive work runs as the user.
Scheduled or shared workflows run as service accounts with only the permissions they need.
Sierra · Building Sierra’s MCP gateway, Lesson 7
This is the gate from August, with the org chart written into it.
built narrowly · canConfer() for one action familyA worker can never grant itself more than the people above it hold.
034 §2; canConfer(), report §7.3; report §10.7
LENS 3 · PHASE 4
1
check
authorize again, at the call — not because the tool showed up in a list earlier
2
run
a brokered credential, held by the gateway, plus an idempotency record — so a retry can’t run it twice
3
prepare → approve → execute
built, for one action: send a message. A human approves between prepare and execute.
4
shape
the result is reshaped before it goes anywhere — designed generally, built only for this one action
solid border · built
dashed border · designed, not
yet built
result → input
control → state
…we want all write or destructive operations to be tied to user intent and approval.
Sierra · Building Sierra’s MCP gateway, Lesson 6
Every call is checked when it happens, and every effect waits for its approval.
034 §3, §6, §10–§12; report §7.3 built/designed/open table; Sierra capture, Lesson 6
ACT TWO · PHASE 4 · NOW, IN CONSTRUCTION
Too big or too sensitive to hand the model directly — kept by the gateway, referenced, re-checked each read.
An agent can't misuse what it never sees
Sierra
What comes back is part of the next input: one channel the model reads, one it never sees.
034_2 §10, §15–§17
ACT TWO · PHASE 4 · NOW, IN CONSTRUCTION
illustrative
✓acts as Alice, under her grant ✓never touches Globex ✓a summary, not 18,000 messages ✓holds the email for approvalEvery wall is down except the one between the gateway and the loop.
report §10.5; 034 §8, §11
ACT TWO · PHASE 4
built · flue-worker-iter1
built for one action · sending a Buzz message
gateway_whoamidesigned, not built
Five parts still open: connection templates & org connections ·
artifacts with reauthorization · context effects · the useGateway
adapter · context manifest / checkpoint / composer.
Neither half calls the other yet.
report §7.3 built/designed/open table ·
apps/gateway-authority/src/{outcomes,permissions,approvals}.ts
ACT THREE · THE CONTRACT
The MCP gateway determines what an agent is allowed to know and do. Flue determines how permitted information participates in the agent loop.
Persist truth; construct context. Do not persist “the context” as though it were the truth.
034 line 54 · 034_2 line 7 · report §9.1, §9.2
ACT THREE · THE CONTRACT
↓
↓ context → model
The contract is the line between them.
034_2 §37, §40
ACT THREE · THE CONTRACT
Everything else is an implementation of these.
034_2 §38; report §9.3
ACT THREE · THE CONTRACT · CUTTABLE
binding → manifest → mounted tools
call → outcome → projection → checkpoint
re-render → next context → reauthorized re-read
If this loop works, the rest are extensions.
034_2 §39; report §9.3
ACT THREE · THE CONTRACT
Who composes context: the runtime, the gateway, or a split?
Where does the model/control split live, on the wire?
Where does memory live, and who may write it?
Whose identity does a worker act under?
A useGateway adapter now, or after a second connector?
Contract? is still standing.
report §9.4, §9.6
ACT THREE · THE CONTRACT
What may come back?
Who decides what’s used?
What survives the conversation?
The gateway has become what we hoped it would: plumbing.
Sierra · “Releasing the lock”
80% of a workflow rounds down to 0%
Let’s design the contract.
Sierra capture, “Lesson 4” and “Releasing the lock” · report §9.6
APPENDIX · GLOSSARY
use*-prefixed function that attaches one
capability (model, tool, state) inside a Flue agent function.withastro
GitHub org, our Phase 3 and 4 workers build on.One line each, to check a definition after the fact.
report §3, §12.5 A1; Terms introduced, §§5–9
APPENDIX · ICEBERG
Gold-edged items (9 of 45) shape what re-enters the model’s next call — the same nine that turn gold on slide seven. This five-column split is ours; Sierra’s post never sorts its 45 items this way.
Nine items, the same nine gold ones from slide seven, decide what the model sees next.
report §8.3; Sierra capture, figure 1 transcription (lines 127–188)
APPENDIX · SIERRA’S LESSONS
| Lesson | One sentence | Our disposition |
|---|---|---|
| 1 · Grab the lock | One team solving auth, audit and integration for everyone beats every team wiring its own stack. | Present — validates the gateway over direct connections |
| 2 · Coding agents still need humans | Agents cheat at self-verification; smoke-test with weaker agents; keep a living invariants doc. | Process — how we build our gateway, not a diagram wall |
| 3 · An agent can’t misuse what it never sees | Response-level tagging plus multi-pass classification blocks cross-customer leakage. | Present, partly deferred — audit and approval present; summarization adopted; tagging and DLP deferred to multi-customer workflows |
| 4 · 80% of a workflow rounds down to 0% | Partial workflow coverage captures none of the adoption value. | Adopted in part — curated views and REST synthesis adopted; the 80/20 catalog rule itself proposed, not adopted; sidecars/multi-region deferred |
| 5 · Avoid the strategy tax | Deep Pinecone integration without requiring it — any client gets real data day one. | Present — the gateway’s per-worker framing serves any harness, not one |
| 6 · Don’t fight the weights | GitHub’s full MCP server lost to the gh/aws CLIs agents already know, behind a minted scoped token. |
Adopted — scoped-credential egress shape; writes tied to intent present |
| 7 · Human identity and agent identity | Interactive work runs as the user; scheduled or shared work runs as a service account; pre-authorized workflows add a third safeguard. | Present, reframed — principals model present; pre-authorization present in spirit, no named artifact yet; service owners adopted with a stricter review gate |
Lesson 7, compared — an open question, not a resolved one. Sierra keys identity to the kind of work: interactive work runs as the user, scheduled or shared work runs as a service account. Our worker design keys identity to the worker itself: the AI worker is the authenticated subject in every case, and a human enters only as delegated authority. Sierra reasons more simply per call; ours keeps one identity and audit trail per worker across interactive and autonomous use. Neither is shown wrong — see slide 28.
Sierra reasons per call; ours keeps one identity and audit trail per worker.
report §8.4, §8.6
APPENDIX · MEMORY CLASSES
| Memory / state class | Lifetime | Scope | Canonical owner |
|---|---|---|---|
| Working context | One LLM call | Turn | Flue harness |
| Conversation history | Conversation | Conversation | Flue |
| Operational state | Conversation/task | Conversation | Flue usePersistentState |
| Episodic memory | Across conversations | User/worker/org | Gateway context service |
| Semantic memory | Across conversations | User/worker/org | Gateway context service / systems of record |
| Memory / state class | Lifetime | Scope | Canonical owner |
|---|---|---|---|
| Procedural memory | Versioned | Organization/worker | Skills / policy–context registry |
| Artifact memory | Potentially long-lived | Task/user/org | Artifact/resource store |
| Workspace memory | Task/session | Agent/workspace | Sandbox provider |
| Capability state | Dynamic | Principal | Gateway |
| Authorization state | Dynamic | Principal | Gateway |
Ten kinds of state this talk used loosely, split by lifetime, scope and owner.
034_2 §3
APPENDIX · RESPONSIBILITY
| Concern | Gateway | Flue |
|---|---|---|
| Tenant isolation | Owns | Enforces conversation access too |
| Worker identity | Owns | Carries binding |
| Human delegation | Owns | Carries reference |
| Tool authorization | Owns | Never overrides |
| Capability catalog | Owns | Projects into model |
| External memory store | Owns / mediates | Queries through contract |
| Memory authorization | Owns | — |
| Conversation transcript | — | Owns |
| Conversation control state | — | Owns |
| Concern | Gateway | Flue |
|---|---|---|
| Context strategy | Supplies profile/config | Primarily owns |
| Token budgeting | Advises | Owns |
| Model-specific formatting | — | Owns |
| Raw tool result policy | Owns | — |
| Model-visible tool result | Defines safe projection | Persists/projects |
| Artifact storage | Gateway/object store | References |
| Prompt compaction | — | Owns |
| Context observability | Shared | Shared |
Identity and policy on one side, presentation and ranking on the other.
034_2 §35
APPENDIX · EPOCHS
contract version — the shape of the contract itselfprofile version — which composition strategy is pinnedorgConfig epoch — org-wide policy and configurationauthorization epoch — permissions; a revocation invalidates rediscoverycatalog epoch — the tool catalog; a new tool need not invalidate memorymemory epoch — memory candidates; a new memory need not rediscover toolsartifact version — one artifact’s contenttool schema version — one tool’s call shapepolicy_revisioncatalog_fingerprintbinding_fingerprintrelay_binding_revisionAccumulated independently, without a name for the pattern, in
apps/gateway-authority/src/approvals.ts’s row types — Buzz-specific,
not yet reconciled with 034_2’s vocabulary (report §9.4 Q5).
Four fingerprint fields shipping today, unreconciled with the proposed eight.
034_2 §29; report §9.4 Q5
APPENDIX · EVIDENCE
Without a fixed date: the move to Flue followed an initial rejection of
Flue (worker-rooms v1) and then a spike that ran end to end (report §7.2a).
Remy’s phase windows, with the repos that evidence activity inside each.
report §7.1, §7.2a, §7.3, as evidenced in the repos
APPENDIX · CLAIMS
MCP protocol revision 2026-07-28 is real, and is what SDK v2 targets
@modelcontextprotocol/* pinned 2.0.0; source map cites it
Mcp-Method / Mcp-Name are real HTTP headers in the SDK
server dist .d.mts:1180,1182
MRTR / input_required exists in the SDK
built for elicitation, not human approval
MCP has a formal reverse-DNS extension-ID mechanism
no occurrence in the installed SDK bundle
MCP tool result content is flattened to text for the model
@flue/runtime docs, agent-api.md:701
Flue’s turn_request is in-process only, never persisted
@flue/runtime docs, events.md:326
useAgentStart loads data before the model executes; can
modify capabilities
agent-hooks-api.md:271–289
Anthropic’s Managed Agents split the session log from context management the same way
no local Anthropic source to check against
MCP maintainers have an August 2026 roadmap for multiple result representations
no roadmap document available locally
034’s citation markers throughout the document
citations behind roughly a dozen markers did not survive export
What’s traced to a source, and what still needs one.
report §9.5, §14