Demo: a three-act live show with a photo-editing agent¶
Status: design only. Nothing here is built or run as a whole. The demo application and
the camera tool do not exist yet. Latencies are estimates unless a row in
compatibility.md says otherwise; bracketed IDs such as [L1], [K9] or
[N22] point to those rows. The gateway side of this design (tool calls through
Agentgateway, the rate limit, the public listener, tracing, sandbox egress through the
gateway) exists as manifests and was applied in throwaway local VMs with stand-ins for
the missing code (sections N and P of compatibility.md). Where it runs is described in
deployment-options.md.
This is the second iteration of the demo design (owner decisions of 2026-11-27,
design.md, section 10). What it replaces, and what it keeps:
| First iteration | Second iteration (this document) | |
|---|---|---|
| Main line | One flow: scan, upload a photo, instruct, see the result | Three acts in about 8 minutes: a group photo, the audience takes over, guardrails. The first flow is now Act 2, unchanged in substance |
| Tool calls | The harness talked to the OpenSandbox MCP server and to the demo application directly; whether MCP went through Agentgateway was open | Every tool call goes through Agentgateway, which authenticates the caller and authorises each tool |
| Tools of the agent | Two: sandbox, edit_image |
Three: the stage camera is new |
| Observability | Metrics only | Metrics and distributed tracing (Jaeger), off by default in Local. One job is one trace: the demo application hands each job's trace context to the harness (section 10) |
| Sandbox egress | Closed by a NetworkPolicy; a blocked attempt was visible only as a failed tool result |
Through an Agentgateway listener that refuses it with a status, a counter, a log line and a span; the NetworkPolicy stays behind it as the enforcement |
| New code | One piece, the demo application | Two small pieces: the demo application and the camera tool |
The reference for the form is the closing keynote of KubeCon + CloudNativeCon North America 2026 ("Drone 2"): one live, visible scene that ties the technologies together, with the audience taking part. Its author describes agents on agent-substrate and kagent, Agentgateway in three roles (LLM gateway, egress gateway, MCP gateway with an identity provider) and OpenTelemetry with Jaeger showing rate-limit errors and the duration of each tool call [N48]. What the agents made the drone do is not in that description [N49]. This design learns from the form and does not copy it: there is no drone, no controllable hardware, no identity provider, and the egress-gateway role is a simpler one than the keynote's: there it is part of agent-substrate and knows the sandbox by identity [N12]; here the gateway is the sandboxes' HTTP proxy and knows them by address (section 10).
The first iteration replaced the earlier representative workload, an agent that built a Kubernetes GPU workload config checker from a terminal in five steps. The five capabilities it exercised (inference, sandboxed execution, memory, session handoff, concurrency) are all still exercised; section 5 maps them.
1. What the audience sees¶
Act 1, the group photo (about 1 min 45 s). The presenter asks the agent to look at the room. While a QR code is on the screen, the audience votes on their phones for a theme: flying, space, ink painting. The vote closes, the agent takes one picture with the camera on stage, edits it in the winning theme, and the big screen shows the room, transformed. One request, prepared and rehearsed: the reliable opener.
Act 2, the audience takes over (about 2 min 30 s). The first iteration's flow. Anyone scans the QR code, photographs something with their own phone, says or types an instruction, and their result joins a gallery wall. Many requests at once make the infrastructure visible beside the wall: which model replica answered, how the GPU's memory is split, sandboxes appearing and disappearing.
Act 3, guardrails (about 2 min 15 s). Two deliberate interceptions and one trace.
- (a) The presenter asks everyone to tap a button as fast as they can. The gateway lets a fixed number of requests through each second and rejects the rest; every phone and the big screen show the rejections counting up.
- (b) An instruction to send a photo to an outside site. The command runs in a sandbox and fails: the sandbox has no way out. The screen shows the failed attempt.
- (c) The trace of the Act 1 request is opened: time per hop, from the gateway through the model and the sandbox to the image model.
Close, memory (about 40 s). "Make the group photo more dramatic." The agent continues from the Act 1 image without being told which one.
The timed script, with what the presenter says and what each screen shows, is section 9. The first iteration's five-step description of the single flow is superseded by Act 2 and by section 3, which still gives its request sequence.
The owner's earlier reference was a live photo demo from a CNCF keynote, for which no public description was found [L20].
2. Parts¶
flowchart LR
subgraph audience
PH[Phone page]
BS[Big-screen page]
end
subgraph stage
CAM[Camera tool<br/>new code, on the machine<br/>the camera is plugged into]
end
subgraph cluster
GWP[Agentgateway<br/>public listener]
GW[Agentgateway<br/>internal listener:<br/>models, /mcp]
APP[Demo app<br/>new code]
DSH[DeepSeek Harness<br/>agent loop, SDK runtime<br/>in the demo app's pod]
PC[PowerContext + seekdb]
OMCP[OpenSandbox MCP server]
OSB[OpenSandbox]
SB[Sandbox pod<br/>gVisor by default, Kata as opt-in]
EPP[llm-d EPP]
PROM[Prometheus]
JG[Jaeger]
end
subgraph models
LLM[Small model<br/>Cloud: 2x vLLM on HAMi slices<br/>Local: llama.cpp on the Mac]
IMG[Image editing<br/>Cloud: FLUX.2 klein on vLLM-Omni<br/>Local: external API]
STT[Speech to text<br/>Cloud: Whisper on vLLM<br/>Local: none by default]
end
PH -- HTTPS --> GWP
BS -- HTTPS, WebSocket --> GWP
CAM -- HTTPS: the frame --> GWP
GWP --> APP
APP --> DSH
DSH -- model calls --> GW
DSH -- MCP, API key --> GW
GW -- MCP: capture_frame --> CAM
GW -- MCP: command_run --> OMCP --> OSB --> SB
GW -- MCP: edit_image --> APP
APP -- images, audio --> GW
APP -- create, fill, delete sandboxes --> OSB
GW --> EPP --> LLM
GW --> IMG
GW --> STT
DSH --> PC
APP -- fixed queries --> PROM
APP -- fixed queries --> JG
GW -. spans .-> JG
One Agentgateway, two listeners. The public listener is what phones, the big screen and the camera tool's upload reach; it accepts routes from the demo application's namespace only. Model traffic and the MCP endpoint are on the internal listener and cannot be reached from outside [N23].
Phone page¶
A single static page served by the demo app. No install, no account. Its view follows the act the presenter is in, pushed over the page's WebSocket: vote, upload or tap.
- Vote (Act 1): one button per theme. Section 11.
- Camera (Act 2):
<input type="file" accept="image/*" capture="environment">, which opens the phone's camera app. It needs no camera permission prompt in the browser. - Before upload, in the browser: scale the photo down to at most 1536 px on the long side and re-encode it through a canvas. This cuts the upload to a few hundred kilobytes and drops EXIF data, including GPS position.
- Instruction: a text box. Voice is either the phone keyboard's dictation (always
available, nothing reaches the lab as audio) or, in Cloud, a recorded clip sent for
transcription. Recording in the page needs
getUserMedia, which browsers allow only on HTTPS pages [L21]. - Tap (Act 3a): one large button and two counters, "accepted" and "rejected by the gateway". Section 10.
- Notice and consent before the first upload (section 7).
- Afterwards: queue position, progress steps, the result, a follow-up box, and a "delete my images" button.
Big-screen page¶
One page, opened by the presenter with a token in the URL. The presenter moves it from view to view with the keyboard; each view is fed by the same WebSocket.
| View | Used in | Shows |
|---|---|---|
| Vote | Act 1 | The QR code, one bar per theme growing live, the number of votes, then the winner |
| Stage | Act 1, close | The stage job's steps as they happen (camera, sandbox, image model) and then the image, full screen, labelled "AI-edited" |
| Wall | Act 2 | The gallery wall, newest first, each image with its instruction and the "AI-edited" label; beside it the infrastructure panels below |
| Guardrails | Act 3 a, b | Left: the tap counters and the limit in force. Right: the egress attempt, its command and the gateway's answer (403), the gateway's counter of refused egress requests going up, and the receiving end's counter, at zero |
| Trace | Act 3 c | A waterfall of one request, which is one trace: one row per hop, bars to scale, durations in milliseconds (section 10) |
Every panel names its data source; a panel with no source in the current option says so instead of showing a mock.
| Panel | Cloud source | Local |
|---|---|---|
| Vote tally | Demo app (in memory) | Same |
| Which replica served | llm-d EPP llm_d_epp_scheduler_attempts_total per endpoint; vLLM vllm:request_success per pod |
Shown for the simulated pool only, labelled "simulated backends". The real model is one process on the Mac |
| GPU memory split | HAMi hami_vgpu_memory_used_bytes and hami_vgpu_memory_limit_bytes per container |
"Not available in Local: no NVIDIA GPU." |
| Sandboxes created and destroyed | Pods in namespace opensandbox (kube-state-metrics, or a watch by the demo app) |
Same |
| Queue and stage timings | Demo app | Same |
| Taps accepted | Demo app: requests that reached /api/tap |
Same |
| Taps rejected | Prometheus: agentgateway_requests_total with route="demo/demo-tap", status="429", reason="RateLimit" [N19], scraped every 5 s; and, live, the sum of the rejections each phone counted itself, labelled "as seen by phones" |
Same |
| Blocked egress | Prometheus: agentgateway_requests_total with listener="egress", route="inference/sandbox-egress-deny", status="403" [P11], scraped every 5 s; live, the tool result of the attempt, which carries the gateway's 403 and its message; the refused request's span in the job's trace; the receiving endpoint's hit counter in the demo app |
Same; the span only with TRACING=on |
| Trace | Jaeger's query API through the demo app [N28] | Same when tracing is switched on (TRACING=on). By default it is off in Local: the demo app's own stage timings, labelled "timings measured by the demo application, not a trace" |
A per-request "this image was served by replica B" was an open point in the first
iteration. The gateway has a field for it, inferencepool.selected_endpoint, on its logs
and spans [N35]; it has not been seen in a running system. Until it has, the counters
above give the split over time, not the attribution of one image.
- Presenter controls: next view; open and close the vote; start the stage job; start the egress drill; pause intake; approve or reject a held image; purge everything.
- The QR code, with a short event code that the presenter can rotate.
Where the harness sits now¶
Decided by the owner on 2026-11-27: the DeepSeek Harness is the agent loop, embedded
through its SDK and running in the cluster (design.md, section 10).
The harness was designed in as a terminal program on the developer's MacBook. That placement no longer fits: the entry point is a web application, and no person sits at a terminal in the request path. The harness itself still fits. It ships an SDK mode ("serve SDK clients over stdio JSON-RPC") and a Python SDK that bundles the runtime for Linux x64 and arm64 [L16, L30].
How it is used:
- The demo app imports the SDK (
deepseek-harness-sdk). The SDK starts the bundleddshruntime as a child process of the demo app, in the demo app's pod. There is no separate harness Deployment. - One runtime process per job (follows from the owner's decision on tracing,
2026-11-27; section 10). The demo app starts it with a profile patch that carries that
job's
traceparentin the headers of the model provider and of the MCP server, and closes it when the job ends. The headers are fixed when the runtime starts, so one runtime cannot serve two jobs with two trace ids [P3]. In the probe a runtime started in about 1 s and held about 0.55 GiB while a job ran [P5]. In the first design one runtime was kept and reused. - One harness session per audience session; the session id is what makes a follow-up continue. A follow-up is a new job and so a new runtime: it resumes the session from the harness home on the pod's volume, which the earlier runtime wrote [P6].
- The harness calls the model through Agentgateway, calls its three tools through Agentgateway's MCP endpoint (one Streamable HTTP URL with a static key in a header [N15]), and uses PowerContext for memory. In the first iteration its tools were two MCP servers it reached directly.
- It is to be configured for an unattended, multi-tenant setting: no shell or file tools of its own (only the three tools in section 3; see the caveat below), its own harness home on the pod's volume, and the default upload of session-log events to DeepSeek switched off [L25].
Known caveats, to be checked on real hardware (also risks R18 to R21 in design.md):
| Caveat | What is known | Checked by |
|---|---|---|
| The pinned release | Decided on 2026-11-27: the pin is the SDK deepseek-harness-sdk==0.2.2rc2, which bundles runtime 0.2.2rc2 [L30], because that is what runs. It replaces the CLI pin 0.2.2-rc.1, for which no SDK was published. The cited harness documentation was re-read at the rc.2 tag [L34]; that the runtime is built from that tag is inferred [L31] |
First run of the agent loop |
| PowerContext plugin | Unknown, and accepted as such with the pin. PowerContext 1.6.0 documents acceptance of its plugin against the CLI 0.2.2-rc.1 only and says not to infer support for other releases (compatibility.md, G8). Nothing covers the pinned SDK runtime or the SDK's minimal profile, which leaves out parts of the base profile [L17] |
Install the plugin into the SDK's harness home; /pc doctor or its equivalent; write and read one memory |
| Startup time and memory | Measured once, with a stand-in model and one-tool conversations [P5]: start about 1 s; 0.3 GiB resident idle, about 0.55 GiB after a first session; one runtime with four concurrent sessions 0.58 GiB. With one runtime per job that is about 0.55 GiB per job in flight, more than the 256 Mi the Local budget had set aside for the whole application (deployment-options.md, section 3). Real conversations with images in them will differ [L32] |
Measure again with the real model and the real prompts, in the first run of the agent loop |
| Its own shell tool | The SDK's minimal profile contains local execution and pins full access; upstream says to run it in a disposable checkout or container [L33]. The design wants the agent to have only the three tools of section 3. Whether the profile can be patched to drop local execution was not checked. Until it is, the harness's shell runs in the demo application's pod, next to the application's credentials | Read the bundle reference at the runtime's tag; try a profile patch. If it cannot be removed, run the runtime in its own locked-down container |
| Fit for the task | A coding harness is heavier than "plan an image edit with three tools". Whether its loop with Qwen3-4B picks the right tools in order is unknown [L18], and so is whether it finds them under the names the gateway gives them [N16] | A fixed set of instructions through the loop |
| Tracing | The harness emits no trace spans and does not pass on a trace context of its own [N44]. It does send the static headers it is configured with, so the demo app gives each job's runtime a traceparent, and the gateway then puts every model and tool call of the job into the job's trace. Run once, with a stand-in model [P1, P2, P4] |
The real model and prompts, in the first run of the agent loop |
Fallbacks if those checks fail, kept from the options the decision was made among:
| Fallback | Agent loop | Cost |
|---|---|---|
| B | kagent, promoted from optional to the required path | Changes the layer table: the harness layer goes away or becomes dev-only. kagent needs PostgreSQL (compatibility.md, H3). Not evaluated here |
| C | A tool-calling loop written in the demo app | Removes the Agent Harness layer from the demo: the project would write that layer instead of composing it. About a hundred lines |
Either would need a new owner decision.
3. Tools and request sequence¶
The three tools, all through Agentgateway¶
Decided by the owner on 2026-11-27: all tool calls go through Agentgateway
(design.md, section 10). This closes the question the first iteration left
open, when the harness reached the OpenSandbox MCP server and the demo application
directly.
The harness has one MCP server configured: http://inference-gateway.inference.svc.cluster.local/mcp,
with a static key in the Authorization header. Behind that one endpoint the gateway
multiplexes three MCP servers, prefixes each tool with the name of its server, and shows
the agent exactly three tools
(mcp.yaml):
| Tool, as the agent sees it | Served by | Does | Used for |
|---|---|---|---|
camera_capture_frame() |
The camera tool, on the machine on stage (section 11) | Takes one still frame, uploads it to the demo application, returns a reference to it | Act 1 only |
sandbox_command_run(sandbox_id, command) |
The OpenSandbox MCP server, opensandbox-mcp 1.2.1 |
Runs a command in the job's sandbox | Everything that touches image bytes with ordinary code: decoding the upload, checking and normalising it, and finishing the result (label, thumbnail) |
image_edit_image(prompt) |
The demo application | Asks the image model to edit the session's current image; the application forwards to Agentgateway's /v1/images/edits |
The edit itself |
How the gateway does it, with the evidence:
- Declaration. One
AgentgatewayBackendwith three MCP targets, oneHTTPRoutefor/mcpon the internal listener [N1]. Transport towards each server is Streamable HTTP; the Kubernetes API has no stdio target [N2], so the OpenSandbox MCP server runs as a network service, not as a child of the harness as the first design had it. - Authentication. Agentgateway's own API-key check, with keys in a Secret. No identity provider [N4]. Without a key the gateway answers 401 [N6].
- Authorisation per tool. A rule over the tool's name and server. The OpenSandbox MCP
server offers 21 tools, among them creating, listing and killing sandboxes; the agent
is given
command_runand nothing else from it. A tool outside the rule does not appear in the tool list and a call to it is rejected [N5, N6]. There are two keys with two roles:agentfor the harness, andoperatorfor the demo application's scripted drill in Act 3, which may run a command in a sandbox and nothing more. - Both kinds of server fit. The OpenSandbox MCP server and a small custom server outside the cluster were both served through the same backend in a probe, with stand-ins for the two that are not written [N8, N9].
- Enforced, not only configured. A
NetworkPolicyadmits only the gateway's proxy pods to the OpenSandbox MCP server and to the demo application [N14]. The sandboxNetworkPolicyis unchanged: the MCP server sits in the namespace it already admits.
What stays unknown: the harness as the client of this endpoint, with Qwen3-4B choosing among the prefixed names [N16]; the camera target in Cloud [N11]. Three limits to know:
- A static key identifies the agent, not the job. The rule cannot say "this sandbox only": an agent talked into it could name another job's sandbox, if it knew the id. Sandbox ids are random and live for seconds; the lifecycle tools are hidden. A per-job credential would need an identity provider, which is left out on purpose.
- Creating and deleting sandboxes is not a tool call. The demo application does that through the OpenSandbox SDK, directly, as before. Only what the agent decides to do goes through the gateway.
- A dead tool server can cost time, not correctness. The backend is set to skip a server that fails. In the probe a server that refused connections cost nothing, but one that did not answer cost 10 s whenever a session started or listed tools [N10].
The small model is text-only. It never sees a photo. It turns the instruction, plus what PowerContext remembers of the session, into a precise editing prompt and decides which tools to call. This is stated on the big screen too: the agent plans, the image model looks. For the same reason a tool never returns image bytes to the agent: the camera tool returns a reference, and the image itself travels to the demo application (section 11).
Sequence of one audience job (Act 2)¶
sequenceDiagram
autonumber
participant P as Phone page
participant G as Agentgateway
participant A as Demo app
participant S as Speech model
participant H as DeepSeek Harness (SDK)
participant C as PowerContext
participant E as llm-d EPP
participant L as Small model
participant M as OpenSandbox MCP server
participant O as OpenSandbox
participant K as Sandbox pod (gVisor)
participant I as Image-editing model
participant B as Big-screen page
P->>G: POST /api/jobs (public listener, multipart: photo, text or audio)
G->>A: HTTP (rate limit applied at the gateway)
A-->>P: 202 job id, queue position
A--)B: WebSocket: job queued
opt audio clip (Cloud)
A->>G: POST /v1/audio/transcriptions
G->>S: HTTP
S-->>A: text
end
par while the agent plans
A->>O: create sandbox (HTTP, API key)
O->>K: BatchSandbox, pod with the RuntimeClass of the selected runtime
A->>O: upload the photo into the sandbox
and
A->>H: run(instruction, session id, sandbox id) (stdio JSON-RPC)
H->>C: prepare context for this session (HTTP, bearer token)
C-->>H: earlier instructions, prompts, current image id
H->>G: POST /v1/chat/completions with tools
G->>E: which replica? (gRPC ext-proc, Cloud)
G->>L: HTTP
L-->>H: tool call: sandbox_command_run(normalise)
end
H->>G: MCP tools/call sandbox_command_run (API key)
G->>M: MCP (allowed by the tool rule)
M->>O: run command
O->>K: execd: decode, validate, resize
K-->>H: ok, image facts
H->>G: chat completion (tool result)
G->>L: HTTP
L-->>H: tool call: image_edit_image("...")
H->>G: MCP tools/call image_edit_image
G->>A: MCP
A->>G: POST /v1/images/edits (multipart)
G->>I: Cloud: vLLM-Omni pod. Local: external API over HTTPS
I-->>A: edited image
A->>O: put the result into the sandbox
H->>G: MCP tools/call sandbox_command_run (label, thumbnail)
G->>M: MCP
K-->>A: final image and thumbnail
H->>C: store the turn: instruction, prompt, image id
H-->>A: done
A->>O: delete sandbox
A--)B: WebSocket: result, stage timings
A-->>P: result (polling or WebSocket)
What differs for the stage job (Act 1 and the close)¶
The stage job is the same job, started by the presenter instead of a phone, with one more tool call at the front:
- The vote closes. The demo application builds the instruction from the winning theme (section 11): "Take a picture of the room with the stage camera, then make everyone fly."
- It creates the job and its sandbox, and runs the harness.
- The model's first tool call is
camera_capture_frame. The gateway forwards it to the camera tool on stage. The tool takes one frame and uploads it to the demo application through the public entry, the door audience photos use; the application puts it into the job's sandbox and answers; the tool returns{image_id, width, height}. - From here the sequence is the one above: normalise in the sandbox, edit, finish.
- The close ("make the group photo more dramatic") is a follow-up in the stage session: no camera call, the current image comes from memory.
If the camera fails the job continues from a photo the presenter uploads; section 12.
Notes on individual hops:
- The public entry. The demo app is published through the same Agentgateway as
ordinary
HTTPRoutes on a listener of its own, so one component terminates all traffic and applies rate limits [L2, N23]. - Speech. Agentgateway treats
/v1/audio/transcriptionsas model traffic [L1]; in Cloud it goes to Whisper on vLLM [L3]. - The EPP hop exists in Cloud only. In Local the small model is a single external backend [K12]; the EPP is exercised on the separate simulated gateway.
- Sandbox per job. Created when the job starts, deleted when it ends, so the audience
sees sandboxes come and go. The uploaded file is decoded for the first time inside
the sandbox: parsing an untrusted image is exactly the kind of work the sandbox is for.
The sandbox has no network egress (a
NetworkPolicyon its namespace [M7]); the image model is called by the demo app, not from inside it. - Image editing goes through Agentgateway in both options [L1]. In Local the gateway
holds the provider's key; neither the demo app nor the sandbox sees it. Temporarily not so
(owner decision, 2026-11-29): with the provider adapters the demo application holds the
key and calls the provider itself (
design.md, section 10). The provider the owner chose for Local is Alibaba Model Studio (Bailian), which edits the photo. image_edit_imageloops through the gateway twice: once as a tool call to the demo application, once as the application's model call. The owner's decision names the camera tool and the sandbox tool; this design sends the third tool the same way, so that the rule "every tool call is authenticated, authorised and traced at the gateway" has no exception. The application serves it on a port of its own that no public route points at [N24].- Memory. A follow-up such as "more dramatic" carries no subject. The harness asks
PowerContext for the session's context and gets back the previous instruction, the
prompt that was used and the id of the current image, and the model writes a new prompt
from those. Plainly: the "current image" pointer alone could live in a cookie.
PowerContext is on the path because carrying intent across turns and devices is its
job, and experiment 3 measures it. Which generation and embedding models PowerContext
itself needs is still open (
compatibility.md, G13); if it needs an embedding model the stack does not have, the fallback is to store and read the turn records deterministically through its HTTP API [L19].
4. Reaching it, limits and latency¶
How the audience reaches it¶
Phones are on mobile data or venue Wi-Fi, so the page needs a URL they can reach, and HTTPS if the page records audio [L21]. What is published is the Gateway's public listener (port 8080) and nothing else.
| Cloud | Local | |
|---|---|---|
| Public URL | Needed. design.md publishes nothing today, so this is a change: either an outbound tunnel from the cluster, or a public listener on cp-0 with a domain and a certificate |
A tunnel from the Mac or from a pod. The Mac is behind NAT |
| Venue LAN only | Not applicable | The Mac's LAN address works only if the venue Wi-Fi lets clients reach each other, which guest networks often block; plain HTTP, so no in-page recording |
| Tunnel candidate | Cloudflare Tunnel. A Quick Tunnel needs no account, gives an HTTPS URL, is capped at 200 in-flight requests and does not support Server-Sent Events [L22]; a named tunnel needs an account and a domain | Same |
Server-Sent Events are therefore avoided: the pages use WebSocket with polling as the fallback. Whether WebSocket holds up through a Quick Tunnel was not tested.
Act 3 (a) changes what the entry must carry. A room tapping is hundreds of requests a second for twenty seconds. A Quick Tunnel's cap of 200 requests in flight may be reached before the gateway's limit is, and then the tunnel, not the gateway, would do the rejecting. For the show the recommendation is a named tunnel or a public listener; a Quick Tunnel stays good enough for trying the stack. Not measured either way.
The QR code encodes the URL plus a short event code. The presenter can rotate the code, which invalidates the old QR without changing the URL.
Rate limiting and queueing¶
Written as manifests in this iteration
(demo-entry.yaml); the numbers are
proposals.
- At the gateway, standing: 30 new jobs a minute for the whole entry (burst 10) on
POST /api/jobs. - At the gateway, staged for Act 3 (a): 20 requests a second (burst 20) on
/api/tap, one bucket for the whole room. Section 10. - Not written yet: a request body limit at the gateway.
- In the demo app: one active job per browser session; a cap on jobs per session per
event (proposed: 5); a bounded queue (proposed: 30) that answers "full, try again in a
minute" beyond that; a fixed number of concurrent jobs, Cloud: 4, Local: 1 (owner
decision, 2026-11-28; it was Local: 2); one vote per browser session. The application
reads these numbers from the ConfigMap
demo-limits(demo-limits.yaml; the local profile has its own copy with 1), so the number of jobs in flight belongs to the deployment option and the virtual test can hold it to what the profile declares. A job holds its slot from the start of its sandbox to the delivery of its image; the stage job, the close and the egress drill are jobs like any other and wait for the slot. - Visible: the phone shows its position; the big screen shows queue length.
What the Local option cannot show¶
Decided by the owner on 2026-11-28: the Local option runs one job at a time, and
concurrency is demonstrated in the Cloud option. Each job in flight needs its own
harness runtime and its own sandbox, and the Mac Mini has memory for one of each
(deployment-options.md, section 3). The three acts still run
in Local; these parts of them do not, and the presenter should not suggest otherwise:
| Act | Not shown in Local | What is shown instead |
|---|---|---|
| Act 2 | Several jobs running at once. Requests arrive together but are served one after another | The queue: the phone shows its position, the screen the queue length. Expect 5 to 10 images in the act, not 40 to 75 (estimates) |
| Act 2 | Sandboxes appearing and disappearing side by side. There is one sandbox at a time | One sandbox created and destroyed per job, in sequence |
| Act 2 | Replica routing under real concurrent load. There is one model process on the Mac, and with one job in flight it never has two requests of the demo to spread | The simulated pool's routing, labelled "simulated backends", as before |
| Act 2 | GPU sharing. No NVIDIA GPU (unchanged) | The panel says so |
| Act 3 (a) | Nothing is lost: the rate limit is the gateway's and does not depend on jobs | - |
| Act 3 (b) | The drill beside running audience jobs. It is a job, so it waits for the slot; the presenter pauses intake before it | The same refusal by the gateway |
| Act 3 (c) | Concurrent jobs told apart by trace, which is what one trace per job is for. With one job at a time every trace is alone anyway. And by default tracing is off in Local | With TRACING=on: the stage job's trace. Without: the application's own timings, labelled |
| Close | Nothing is lost | - |
Experiment 1's concurrency levels and anything that says "N jobs at once" are Cloud results.
Expected latency per stage¶
Estimates, except where a probe row is named. No stage has been measured in its real setting.
| Stage | Cloud (estimate) | Local (estimate) | Basis |
|---|---|---|---|
| Upload after in-browser downscale | 1 to 3 s | 1 to 3 s | A few hundred kB over mobile data |
| Camera frame: capture, downscale, upload (Act 1) | 1 to 3 s | 1 to 2 s | Unmeasured. Cloud adds the tunnel from the stage machine |
| Speech to text | 1 to 2 s | 0 (dictation on the phone) | Unmeasured |
| Planning, two to four model turns | 2 to 6 s | 5 to 10 s | Local: one turn with a tool call took 2.4 s in the probe [K17]. Cloud unmeasured. The stage job has one turn more |
| The gateway on a tool call | a few ms | a few ms | The gateway's own share of a tool call was not separable in the probe; a whole command_run round trip through it took 0.23 s [N34] |
| Sandbox ready (gVisor, the default) | about 2 s (inferred [M11]) | about 2 s (verified by local probe: OpenSandbox create call 2.0 to 2.2 s with images on the node [M5, N8]) | Runs in parallel with planning. A command sent at once can fail and is retried [M8] |
| Sandbox ready, Kata opt-in | 1 to 3 s (estimate, unmeasured) | about 20 s cold (verified by local probe, nested virtualization [K9]) | Not the default |
| Sandbox steps (normalise, finish) | 1 to 2 s | 1 to 2 s | Unmeasured |
| Image edit | 2 to 6 s | 5 to 20 s | Unknown in both [L14, L15] |
| One audience job, no queue | about 8 to 15 s | about 12 to 30 s (with the Kata opt-in: 25 to 35 s cold) | Sum of the above; estimates |
| The stage job (Act 1) | about 10 to 18 s | about 15 to 35 s | The same plus the camera step and one model turn |
With gVisor, the default, a sandbox is ready in about 2 s and no pool is needed: each job creates its own and deletes it. With the Kata opt-in, Local's 20-second sandbox start would dominate; only then does the demo app keep a small pool of pre-created sandboxes (Local: 1, with one job at a time) and replace it after use. At these rates the system serves roughly 2 to 4 images per minute in Local, one job at a time, and 15 to 30 in Cloud; a room of a few hundred people will queue, which the caps above turn into a visible, bounded wait. In the two and a half minutes of Act 2 that is some 40 to 75 images in Cloud and 5 to 10 in Local: the wall fills, and most of the room watches rather than gets a turn. Say so on stage.
5. The three experiments on this workload¶
The experiments in ../experiments/README.md keep their
questions and run on demo jobs. That file has the details; in short:
| Experiment | What a "task" is | What the first iteration changed | What this iteration adds |
|---|---|---|---|
| 1. GPU sharing and inference routing | The planning calls of concurrent demo jobs, with image edits running on the same GPU | A third tenant on the card. New metrics: image-edit latency, and LLM time-to-first-token while an edit is running. The concurrency variable becomes concurrent jobs. All jobs share one system prompt, so prefix-cache routing has less to distinguish | Per-request evidence beside the histograms: the gateway's span around each model call, the EPP's scheduling spans and vLLM's own span, where the three line up in one trace [N32, N36, N38]; the replica chosen for one request, if the gateway's field for it is populated [N35] |
| 2. Secure agent execution | One sandbox per job, running the normalise and finish steps on an untrusted upload | Start-up time is now on a path the audience waits on, so "time the sandbox adds to a job" is reported | The egress check runs through the agent's real path, a tool call through the gateway, and the refusal is a gateway decision with a status, a counter and a span [P10, P11, P16]. Tool-call durations per runtime can be read from the gateway's spans [N34]. Nothing new from the sandbox itself: OpenSandbox emits no traces [N41] |
| 3. Context continuity | A follow-up instruction ("more dramatic") after a first edit, from the same phone or from a second one that joins the session | Success is whether the follow-up edits the session's current image with a prompt that carries the earlier intent | The acceptance rule can be checked on what the gateway recorded for the tool calls instead of on the harness's transcript; PowerContext's own spans give the memory latencies its metrics do not name, if it runs with tracing [N42, N43] |
The five steps of the old workload map as follows: inference (planning), execution in a sandbox (image code), memory (follow-ups), session handoff (a second device continues a session), concurrency (many phones at once).
6. The new code: the demo app and the camera tool¶
The project composes existing projects and writes as little as it can. After this iteration that is two small pieces, not one, and the stack has one more component (Jaeger). Both pieces exist because no upstream project provides them; both must stay thin enough to read in one sitting. Neither is written yet.
The demo app¶
It exists because nothing upstream provides "a phone page, a wall and a queue".
In scope
- The phone page (vote, upload and tap views) and the big-screen page (five views), static files, no framework required.
POST /api/jobs, job status, the gallery, one WebSocket channel.- A bounded in-memory job queue and the per-session limits.
- The vote: one vote per session, a tally, a winner (section 11).
- The stage job, and
POST /api/frames, where the camera tool or the presenter's phone delivers the frame for it. /api/tap, which counts and does nothing else, and the egress drill with its receiving endpoint (section 10).- Calling speech to text and image editing through Agentgateway.
- Starting and driving the harness through its SDK, as a child process in the app's own
pod; the
edit_imageMCP tool, on a second port. - Creating, filling, emptying and deleting sandboxes through the OpenSandbox SDK, with a retry of the first command (and a small warm pool only with the Kata opt-in).
- The infrastructure panels: a fixed list of Prometheus queries and a fixed set of Jaeger queries, passed through to the screen. No free-form query endpoint.
- Its own trace spans for a job (OpenTelemetry SDK, a standard library, switched by the
same optional ConfigMap as PowerContext), and handing the job's trace context on: one
harness runtime per job, started with a generated profile patch that carries the job's
traceparent(section 10). - Setting the proxy variables on every sandbox it creates, to the address of the
gateway's
egresslistener (section 10). - Presenter controls: views, vote, stage job, drill, pause, hold for approval, purge.
- Deleting images on schedule (section 7).
Deliberately left out
- Accounts, login, user profiles, analytics.
- A database. State is in memory and in files on one volume; a restart loses the queue.
- More than one replica, high availability, retries across restarts.
- Any model code, any moderation model, any image processing in the app's own process.
- A generic agent framework or tool registry: three tools, of which it provides one.
- A general tracing interface: one waterfall of one request, read-only.
- An admin UI beyond the presenter controls; internationalisation; a mobile app.
- Long-term storage, export, sharing links.
Proposed location: apps/demo/ (the repository layout has no place for first-party code
yet). Proposed size limit: the first iteration proposed about 1,500 lines including the
two pages; the three acts add the vote, the tap and guardrail views, the stage job and
the trace view, so the proposal is now about 2,300 lines, to be confirmed by the
owner. Language: Python, because the harness SDK, the OpenSandbox SDK and the PowerContext
client are Python packages. How its container image is built and where it is published
is an owner decision; the PowerContext image already sets the precedent of building on
the node. The same image also runs the OpenSandbox MCP server, which upstream ships
as a Python package without an image [N7]: a second Deployment, in opensandbox-system,
with another command.
The camera tool¶
It exists because the camera is on stage and the agent's tools are MCP servers. Design in section 11.
In scope: one MCP tool, capture_frame, over Streamable HTTP; opening one configured
camera, taking one frame, scaling and encoding it; uploading it to the demo application;
checking the key the gateway presents.
Deliberately left out: streaming and video; a second tool of any kind; pan, tilt, zoom, lights or any other control; choosing among cameras at call time; looking at the picture (no detection, no description, no vision model); keeping frames; TLS (the tunnel or the loopback interface provides the transport).
Proposed location: apps/camera/. Proposed size limit: about 200 lines. Language:
Python, with the same MCP library the OpenSandbox MCP server uses. It runs as an ordinary
process on macOS, Linux or Windows; it has no container image.
7. Risks and mitigations¶
| Risk | Mitigation |
|---|---|
| Venue network fails or blocks the page | Test on site on mobile data and on the venue Wi-Fi. Keep the presenter's phone on a hotspot as a known-good client. The recorded fallback (section 12) |
| Latency makes the room wait | Bounded queue with visible position; in-browser downscale; a 60 s per-job timeout that returns a clear message. Show stage timings on the screen so that the wait is part of the demo. Act 1 is one job with nothing else running |
| Output quality: the edit ignores the instruction or distorts faces | The small model rewrites the instruction into a precise prompt. One automatic retry at most. The presenter can reject an image before it reaches the wall. The themes of Act 1 are fixed and their prompts tried in rehearsal. Do not promise fidelity: FLUX.2 klein's own card says it may fail to follow prompts [L6] |
| Content safety of prompts | Agentgateway prompt guards on the model route [L2]: a blocklist at minimum (not written yet). The agent's system prompt refuses out-of-scope requests. The image provider's own filter in Local |
| Content safety of outputs | Hold-for-approval is on by default: no image reaches the wall until the presenter taps approve. Automatic output filtering is not relied on: whether vLLM-Omni applies the filters shipped with FLUX.2 klein is unknown, and no moderation model is in the stack |
| Privacy of audience faces | See below. The stage camera raises the stakes: it photographs the whole room |
| Abuse: floods, oversized or malformed uploads, prompt injection | Rate limits and caps (section 4); uploads are parsed only inside a sandbox whose only way out is a gateway listener that refuses everything; the agent has three tools, authorised one by one at the gateway, and one key that opens nothing else; the model and tool routes are not on the public listener; the presenter can pause intake and rotate the event code |
| The camera is not found, is busy, shows a black frame, or cannot be reached from the gateway | Act 1 continues from a photo the presenter uploads (section 12). A camera that fails fast costs nothing; one that does not answer can add 10 s to the start of an agent session [N10], so its reachability is checked before the doors open |
| An interception does not intercept: the room is too small to exceed the limit, or the tunnel rejects before the gateway does, or the sandbox policy is missing after a redeploy | The limit is set in rehearsal against the expected room, and the presenter's phone can exceed it alone with the page's "hold to tap" mode. make verify runs the egress test on every deployment (risk R25). The drill's receiving counter must be 0 at the start and is shown |
| The trace view has nothing to show, or shows several requests mixed | The trace shown is the stage job's, which ran alone. If Jaeger is down or tracing is off, the view falls back to the application's own stage timings and says so |
| The harness runtime is slow to start, heavy, or its PowerContext plugin does not load under the SDK | Start the runtime when the demo app starts, not on the first job. Measure memory before choosing the concurrency limit. If the plugin does not load, read and write the turn records through PowerContext's HTTP API from the demo app [L19]. Fallbacks B and C in section 2 |
| The sandbox runtime (gVisor, the default) is weaker or less compatible than assumed | It is named on the big screen as what it is, a user-space kernel, never as a VM. Egress is closed for all of them. Under gVisor, run the demo's sandbox scripts in rehearsal first [M12]; a command sent right after creation is retried [M8] |
| A component fails on stage | The failure ladder and the recorded fallback, section 12 |
Privacy of audience face photos¶
The photos show people in the room, most of whom did not take the photo. This needs a decision by the owner and, depending on the country and the venue, a legal check; nothing here is legal advice.
The stage camera's frames follow the same rules as audience uploads, and enter by the same door. The differences are that the frame shows the whole room at once and that nobody in it pressed a button. So the spoken notice comes before Act 1, not before Act 2.
- Notice before the first upload, on the phone page, in plain words: what is uploaded, that it is edited by an AI model, that the result is shown publicly on the screen, and where it is processed. In Local that names the external provider. In Cloud it says the photo stays on the lab's servers.
- A checkbox to continue. No pre-ticked box.
- A spoken notice by the presenter and a slide, before the camera is used: a picture of the room will be taken and shown on screen, edited; how to object, and where to sit to be out of the frame.
- Retention: the original is deleted when its job ends; the camera tool keeps no frame after uploading it. Results are kept for the session so follow-ups work, and everything is deleted when the presenter purges or the environment is destroyed. Proposed hard limit: 2 hours.
- Deletion on request: a "delete my images" button tied to the browser session removes that session's images from the wall and from storage at once. The group photo belongs to the presenter's session; the presenter removes it on request.
- Data minimisation: EXIF and GPS are dropped in the browser; the camera frame has
none. No accounts, no analytics, no IP addresses in application logs. PowerContext
stores text and image ids, not images. Prometheus stores no image data. Traces carry
no image data and no instruction text: the gateway's spans record routes, tools,
durations and status, and the application's spans are to record stage names and ids
only. The gateway does record client addresses on its spans (
client.addresswas seen in the probe); behind a tunnel that is the tunnel's address. Jaeger keeps traces in memory and loses them on restart. - The egress drill uses no photo of anyone: its payload is a generated test card.
- Third parties: in Local the photo goes to the chosen provider; its retention and training terms are part of the provider decision. In Cloud nothing leaves the cluster, except that the camera frame travels from the stage machine to the cluster.
- No recording by default: the wall is not saved or published by the lab. A recording of the talk is the event's matter and should be raised with the organiser.
8. Open decisions for the owner¶
Decided since the first iteration: the three acts as the main line; all tool calls
through Agentgateway; tracing as a new component that Local can switch off
(2026-11-27, design.md section 10). The numbering below continues the first
iteration's list; items 11 to 24 are new.
- Decided 2026-11-27: the agent loop is the DeepSeek Harness through its SDK, in the
cluster, pinned to the SDK
0.2.2rc2(section 2). No longer open. What stays unknown is listed there, first of all the PowerContext plugin under that release. - Public entry: tunnel or public listener, and for Cloud the change to "nothing is
published" in
design.md. Section 4. Recommendation, new: not a Quick Tunnel for the show, because of Act 3 (a). - Hold-for-approval by default, and who approves on stage. With a script of eight minutes the approver should not be the presenter.
- Privacy terms: the notice text, the retention limit, and whether a legal check is needed for the venue. The stage camera makes this more pressing.
- Speech: recorded clips with server-side transcription, or phone dictation only.
- Follow-ups edit the last result or the original photo. This design assumes the last result.
- Limits: jobs per person, queue length, concurrent jobs.
- The demo app: location (
apps/demo/), language, size limit (now about 2,300 lines), and how its image is built and published. - The recorded fallback: who records it and when.
- Experiment changes in
experiments/README.md. edit_imagethrough the gateway too. The decision names the camera tool and the sandbox tool. Recommendation: yes, as designed here, so that the rule has no exception; the cost is one more hop inside the cluster.- The agent's sandbox tool is
command_runalone of the 21 the OpenSandbox MCP server offers. Recommendation: yes. Files are placed by the application. - Decided 2026-11-27: the tracing backend is Jaeger. Reasons in section 10. Whether
other layers change project to make traces end to end is a new, separate question:
observability-options.md. - Decided 2026-11-27: tracing in Local is off by default and switched on with
TRACING=onwhen wanted. (The recommendation here was "on"; the owner decided otherwise because only 0.25 GiB would be spare.) A Local show that wants the trace of Act 3 (c) switches it on for the show. - How Act 3 (b) is staged: a scripted drill that runs the upload command for the agent, or a live instruction to the agent. Recommendation: the scripted drill, said to be one. A live attempt can precede it if rehearsal shows that the model does it every time; nothing suggests that today [L18].
- The trace view: a simplified waterfall drawn by the demo application, or Jaeger's own interface embedded. Recommendation: draw it. One request is now one trace, which Jaeger's interface could show, but its interface is not made to be read from the back of a room. Jaeger's interface stays available to the presenter by port-forward.
- The camera in Cloud: the camera tool on the stage machine, reached through an outbound tunnel, as designed; or bring the Local option to the venue and keep Cloud for the experiments. Recommendation: the tunnel, tried in a rehearsal first; it is the least tested hop of the design [N11].
- The rate-limit numbers (20 a second, burst 20) and the tap length. Recommendation: tune in rehearsal with the phones available.
- The themes of the vote, their prompts, and the tie rule. Recommendation: three themes, each tried on a photo of a room beforehand; a tie goes to the theme that reached the count first.
- The camera tool: location (
apps/camera/), size limit (about 200 lines), and the capture library. - The OpenSandbox MCP server has no image. Recommendation: run it from the demo application's image, as its own Deployment. The alternative is a second locally built image.
- No per-job credential for tools. A static key identifies the agent, not the job (section 3). Recommendation: accept for the demo and say so; the remedy is an identity provider, which the owner's constraints leave out.
- Decided 2026-11-27: observability variant V1. No component is replaced. The
demo application gives each job's harness runtime the job's
traceparent, and sandbox HTTP egress goes through an Agentgateway listener (section 10). Both were probed before being written in here. - Decided 2026-11-28: the Local option runs one job at a time. One harness runtime per job costs about 0.55 GiB per job in flight [P5]; in Cloud that is memory on the CPU node, in Local it does not fit beside two sandboxes. Concurrency is demonstrated in Cloud. What Local therefore cannot show: section 4.
Decisions about where it runs (VM route, image provider) are listed in
deployment-options.md, section 10.
9. Run of show¶
Eight minutes. Times are a plan; every latency in it is an estimate from section 4 and is marked "est.". The Cloud column of latencies is used; in Local add 5 to 15 s to each job and shorten Act 2 by the same. P is the presenter; a second person, the operator, approves images and can press every presenter control.
| Time | P says and does | Big screen | Phones | Expected latency | Can fail, and then |
|---|---|---|---|---|---|
| 0:00 to 0:30 | Opens. "You are about to be photographed and edited by an AI model. The picture goes on this screen and nowhere else; sit on the left if you would rather not be in it." Points at the QR code | Vote view: QR code, privacy slide beside it | Scan; the page opens on the vote | Page load 1 to 3 s est. | Venue network: P's hotspot phone; in the worst case the recorded run (section 12) |
| 0:30 to 0:55 | "Agent, have a look at the room. Everyone: choose what it should do with us." Opens the vote | Bars grow; vote count | One tap on a theme | Tally live, under 1 s est. | Few votes: P votes on the stage phone; the tally needs one vote. No votes at all: the first theme |
| 0:55 to 1:00 | "Three, two, one." Closes the vote, which starts the stage job | Winner; then Stage view, step "camera" | Show the winner | Camera step 1 to 3 s est. | Camera fails: the screen says "camera unavailable"; P takes the room with the stage phone and uploads it, the job continues (+10 s est.) |
| 1:00 to 1:20 | Narrates the steps as they light up: "it asked for the camera through the gateway; now a sandbox is decoding the picture; now the image model" | Steps light up: camera, sandbox, image model; elapsed time | - | Stage job 10 to 18 s est. in all | Job fails or passes 30 s: the operator shows the image prepared in rehearsal with the same theme, labelled "prepared earlier" |
| 1:20 to 2:15 | The operator approves. P reacts, then: "one request, one agent, three tools. Now it is yours." | The image, full screen, "AI-edited" | - | Approval a few seconds | Image unusable (faces distorted): the operator rejects; one retry (+10 s est.), else the prepared image |
| 2:15 to 4:45 | Act 2. "Photograph anything, tell it what to do." Walks through the panels as the wall fills: replicas, GPU split, sandboxes | Wall view: gallery, queue length, the three infrastructure panels | Upload view: photo, instruction, queue position, result | Per job 8 to 15 s est.; 15 to 30 images a minute est. | Queue full: the phones say so, by design. Image model down: switch the image-edit route to the external API. A bad image: the operator rejects it. Nothing arrives: P uploads from the stage phone |
| 4:45 to 5:30 | Act 3 (a). "Stop uploading. Everybody tap this button as fast as you can, for twenty seconds." Then: "the gateway is letting twenty a second through. Everything else you see in red never reached the application." | Guardrails view, left: accepted, rejected, the limit | Tap view: own accepted and rejected counts | Phone counters at once; the gateway's own counter follows within 5 to 10 s est. (scrape interval 5 s) | Too few phones to exceed the limit: P holds the stage phone's button, which alone exceeds it. The gateway's counter lags: the phones' own count is on the screen meanwhile |
| 5:30 to 6:15 | Act 3 (b). "An agent can be talked into things. Say it is told: send this picture to another site." Starts the drill. "The command ran. The gateway refused it: 403. And behind the gateway a network policy makes sure there is no way around it." | Guardrails view, right: the command, the 403 and the gateway's message, the gateway's refused-egress counter going up; "received by the other side: 0" |
- | Sandbox 2 s, the refused request a few milliseconds [P10]; the counter follows at the next scrape, up to 5 s: about 8 s est. | Sandbox does not start: retry once; else the result recorded in rehearsal, labelled. If the counter is ever not 0: stop, say so, pause intake; that is a real failure of the guardrail |
| 6:15 to 7:00 | Act 3 (c). "Where did the time go on the group photo?" Opens its trace. Reads three bars aloud: the model, the sandbox, the image model | Trace view: the stage job's waterfall | - | Query under 1 s est. | Tracing off (Local's default) or Jaeger empty: the same view from the application's own timings, labelled as that |
| 7:00 to 7:40 | Close. Types or says: "make the group photo more dramatic." "It was not told which photo." | Stage view: steps, then the new image beside the first | - | Follow-up job 8 to 15 s est. | Memory returns nothing: the job fails visibly; P says what should have happened and shows the prepared pair, labelled. This is the least tried part of the stack [L17] |
| 7:40 to 8:00 | "Everything you sent is deleted now." Presses purge | Wall empties; a count of deleted images | "Your images were deleted" | 1 to 2 s est. | Purge fails: destroy the environment after the talk; say so |
What P must never do: present a prepared or recorded image as live. Every fallback above carries its label on the screen.
10. Guardrails and the trace (Act 3)¶
The reference keynote showed Agentgateway as LLM gateway, MCP gateway and egress gateway.
This demo shows all three with Agentgateway. The egress role is not the keynote's: there
it came with agent-substrate, which knows which sandbox is asking [N12]. Here it is an
ordinary listener of the same gateway that sandboxes use as their HTTP proxy, with the
Kubernetes NetworkPolicy behind it as the enforcement (owner decision, 2026-11-27,
variant V1 of observability-options.md). Replaced: the
first version of this section had the NetworkPolicy alone, the only evidence on screen
was a failed tool result, and one request was several traces lined up by time.
(a) The rate limit¶
| Mechanism | Agentgateway's local rate limit, a traffic policy on the route /api/tap of the public listener: 20 requests a second, burst 20, one bucket for everyone [N17]. A limit kept inside the one proxy pod; the "global" variant needs an external rate-limit service, which the stack does not have |
| Why one bucket | A per-client limit would need the client's address, and behind a tunnel the gateway sees the tunnel's. One shared bucket makes the outcome independent of the entry, and "the room exceeded the limit together" is the better picture |
| What a client sees | HTTP 429, body rate limit exceeded, retry-after, x-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset [N18]. The phone page counts 204 and 429 and shows both |
| What the big screen reads | agentgateway_requests_total with route="demo/demo-tap", split by status (204 against 429) and reason="RateLimit" [N19], through Prometheus at a 5 s scrape; beside it, live, the rejections the phones counted and reported over their WebSocket |
| In a trace | A rejected request that is sampled is a span with http.response.status_code 429 and reason RateLimit [N20]. The tap route is sampled at 2%, so that thousands of taps do not push the Act 1 trace out of Jaeger's store [N33] |
| Safe to stage | /api/tap does nothing but count. Uploads have their own limit and keep working meanwhile, which is the point of a limit |
| Unknown | The entry's capacity (section 4); the scrape lag on stage; how many phones it takes |
The model routes carry no rate limit yet. The keynote's "rate limiting and controlling access to models" would be a token-based limit on the LLM route, which Agentgateway also has [N17]; it is not needed for the show and not written.
(b) The blocked egress¶
| The path | Every sandbox is created with http_proxy and https_proxy set to the gateway's listener egress, port 3128 (sandbox-egress.yaml). The demo application sets them, with the gateway Service's cluster IP, because sandboxes have no DNS. Programs that honour those variables, curl among them, then send their requests to the gateway |
| What decides | The gateway. The listener has one catch-all route, answered by the gateway itself with 403 and the body egress denied by agentgateway: destination is not on the allow-list. A destination is allowed by adding a route that names its host; the demo has none, because its sandboxes need no destination [P10] |
| What enforces | The NetworkPolicy sandbox-isolation, as before, now with one opening: sandbox pods may connect to the gateway's proxy pods on TCP 3128 and to nothing else. No DNS, no other port of the gateway, no direct connection. K3s enforces it with its built-in kube-router controller [N21]. It is still needed: with the policy removed, a sandbox that ignored the proxy reached the internet directly [P15] |
| HTTPS | A CONNECT request is routed like any other, so it meets the same catch-all and gets the same 403 [P12]. This makes refusing uniform. It does not make HTTPS to an allowed host work: that needs the gateway's tunnel mode, not tried [N13] |
| Not HTTP, or not through the proxy | Never reaches the gateway. The NetworkPolicy rejects it: a literal address fails at once (curl exit code 7), a name fails to resolve (exit code 6 after 5 s). This part is as invisible as before: no event, no counter [N21, P14] |
| What the attempt is | A drill the presenter starts. The demo application creates a sandbox, puts a generated test card in it (never a photo of a person), and, with the operator key, calls sandbox_command_run through the gateway: an upload of the card with curl to an external host name. It puts the drill's traceparent on the tool call and on the command's own request. This is what a tricked agent would run; the application runs it so that it is the same every time |
| What comes back | An ordinary tool result with the gateway's answer in it: HTTP 403 and the message above, in a few milliseconds [P10] |
| What the big screen shows | The command and the 403; the gateway's counter of refused egress requests going up by one, agentgateway_requests_total{listener="egress",route="inference/sandbox-egress-deny",status="403"} (its reason label reads DirectResponse) [P11]; the refused request as a span in the drill's trace, next to the tool call, with the host it asked for in server.address [P16]; and the receiving endpoint's counter, 0 |
| What the gateway logs | One line per refused request: listener=egress route=inference/sandbox-egress-deny ... http.host=<the host> http.path=<the path> http.status=403 ... reason=DirectResponse, with the trace id [P11] |
| What it cannot show | Which sandbox asked, by name: the gateway sees the pod's address (src.addr in the log, client.address on the span), which the demo application maps to the job. And nothing at all for traffic that does not go through the proxy |
| Honest sentence on stage | "The gateway refused it. Behind the gateway, a network policy makes sure there is no way around it." |
| Safe to stage | The target is a host name under .invalid, which resolves nowhere, and the request never leaves the gateway. The lab's own receiving endpoint stays in the drill as a second check: if its counter is not 0, the guardrail has failed and the screen says so |
| Repeatable | Rehearsal runs three requests from a sandbox: the drill (403, counter up, receiver 0); http://egress-check.invalid/, which the gateway answers with 200 itself, to show that sandboxes reach the proxy at all; and a direct request that ignores the proxy, which must fail. make verify runs the same three on every deployment (risk R25) |
| A live attempt | The presenter may first give the agent the instruction itself. Whether the model then calls the tool, refuses, or does something else is not known [L18], and the system prompt is meant to refuse such requests. If it does run an upload, the gateway refuses it the same way; that request carries no traceparent, so its span is a trace of its own, found by time and by the sandbox's address. An optional prelude, never the evidence |
| Probed | From a sandbox created by OpenSandbox under gVisor, with these manifests as committed [P10 to P16]. Not probed: under Kata or runc, on x86_64, and a library that ignores the proxy variables, which simply meets the NetworkPolicy |
(c) The trace¶
Backend: Jaeger v2.23.0, one pod, traces in memory
(components/jaeger). The choice, by the project's principles:
| Jaeger v2 | Grafana Tempo | No backend, spans in logs | |
|---|---|---|---|
| One layer, one project | One new project, for a new layer | One new project too; Grafana is its interface, not its storage | None |
| Small footprint | One image, one pod; 30 to 48 Mi observed in the probe [N27] | One pod in single-binary mode; not tried | Nothing |
| Official chart | jaegertracing/helm-charts, current [N26] |
The single-binary chart is deprecated in Grafana's repository; its successor is community-maintained [N29] | - |
| arm64 image | Yes [N26] | Not checked | - |
| Receives OTLP itself | Yes: it is built as an OpenTelemetry Collector [N25] | Yes | - |
| Its own interface and query API | Yes; the API was exercised [N28] | No: read through Grafana | No |
| Used upstream | llm-d's tracing guide uses it [N30]; the reference keynote used it [N48] | Named by llm-d as an option for long retention | - |
Jaeger is chosen. Tempo's advantage, that Grafana is already there, is smaller than it looks: Grafana can read Jaeger as well, and the monitoring values add it as a data source.
No OpenTelemetry Collector. llm-d's guide puts one in front of Jaeger to drop
/metrics spans and to batch [N30]. Jaeger v2 receives OTLP directly and batches itself,
and every component that traces here exports OTLP. One component fewer; that it is
equivalent has not been run with the EPP or vLLM [N31].
Who emits, and how it is switched on:
| Component (pinned) | Emits traces | Switched on by | Continues an incoming trace | Passes it on |
|---|---|---|---|---|
| Agentgateway v1.7.0 | Yes [N32, N33] | The tracing policy on the Gateway (tracing-wiring.yaml) |
Yes | Yes, to model, EPP, MCP server and HTTP backend |
| llm-d EPP v1.0.0 | Yes [N36] | router.tracing in the chart values; Cloud only |
Yes, from the request headers; with the gateway, inferred [N37] | Yes, into the request headers |
| vLLM v0.31.0 (small model, Whisper) | Yes [N38] | --otlp-traces-endpoint in the manifests; Cloud only |
Yes | Nothing downstream |
| vLLM-Omni v0.30.0 (image model) | No [N40] | - | - | - |
OpenSandbox 1.2.1 (server, controller, execd, MCP server) |
No; metrics only [N41] | - | - | - |
| PowerContext 1.6.0 | Yes [N42]; untried here [N43] | An optional ConfigMap of environment variables, present when tracing is on | Yes, on HTTP requests | Not through the harness plugin (not claimed upstream) |
| DeepSeek Harness SDK 0.2.2rc2 | No [N44] | - | Not itself. It sends the static traceparent header its runtime was started with [P1] |
That header, on every model and tool call |
| llama.cpp (Local model) | Unknown [N46] | - | - | - |
| Demo app (to be written) | To do: a span per job and per stage | The same optional ConfigMap | Yes: the gateway hands it the request's trace | Yes, on its own calls (speech, image edit), and to the harness: it starts each job's runtime with the job's traceparent |
| Camera tool (to be written) | No spans of its own planned | - | - | - |
One request is one trace (owner decision, 2026-11-27). The harness cannot continue a
trace, but it sends the headers it is configured with, and the gateway continues any
traceparent it receives [N33]. So the demo application does the harness's part:
- The job's request arrives through the gateway, which hands the application a trace. The application opens a span for the job and, inside it, a span "agent run".
- It starts the job's harness runtime with a profile patch in which the model provider
and the MCP server each carry the header
traceparent: 00-<trace id>-<id of the agent run span>-01. - Every model call and every tool call of that runtime reaches the gateway with that header. The gateway's spans become children of "agent run", and the gateway passes the context on to the EPP, vLLM and the MCP server.
one trace
phone or presenter -> gateway (public) -> demo app: job
demo app -> gateway -> speech model
demo app: sandbox create (its own span; OpenSandbox emits none)
demo app: agent run
gateway -> EPP -> vLLM one group of spans per model turn
gateway -> MCP server one per tool call; the gateway's span is the tool's duration [N34]
gateway (egress): refused only when the command's request carries the header (the drill)
demo app -> gateway -> image model (inside image_edit_image)
separate, short traces
camera tool -> gateway (public) -> demo app the frame upload (Act 1)
harness plugin -> PowerContext its own spans, if it traces
Run once in a local probe with the pinned SDK, this repository's gateway manifests and a stand-in for the model: one job was one trace of 19 spans; three jobs at the same time were three traces of 25 spans each, every span under its own job; the model server received the job's trace id [P1, P2, P4]. Not in the probe: the real model, the EPP and vLLM, the PowerContext plugin, the demo application itself.
Limits, said plainly:
- The tree is flat under "agent run". The harness's turns are not spans. The order and duration of the model and tool calls is there; which turn a call belongs to is read from the order.
- One runtime per job. The header is fixed when a runtime starts [P3], so each job in flight has its own runtime: about 1 s to start and about 0.55 GiB while it runs [P5]. A warm runtime shared by all jobs, as first designed, cannot carry per-job values.
- A delay seen in one setting and not explained: with the harness running on the node itself and addressing the gateway by cluster IP, the first turn of every runtime waited about 21 s. From a pod, which is where the demo application runs, the same job took 2 s [P8]. Rehearsal times the first turn.
- Inside the sandbox and inside the image model there is still nothing [N40, N41].
The waterfall the screen draws, one row per hop:
| Row | From | Cloud | Local with TRACING=on |
|---|---|---|---|
| Gateway, public entry | Gateway server span | Yes | Yes |
| Camera | Gateway server span tools/call, tool capture_frame |
Yes | Yes |
| Model, per turn | Gateway span around the call; vLLM llm_request inside it |
Yes, both | Gateway span only |
| Replica choice | Gateway callout span; EPP spans inside it | Yes (inferred to join [N37]) | Not on the demo's path |
| Sandbox, creation | Demo app span | Yes | Yes |
| Sandbox, per command | Gateway server span tools/call, tool command_run |
Yes | Yes |
| Refused egress (the drill) | Gateway server span on the listener egress, status 403, with the host asked for |
Yes | Yes |
| Image model | Gateway span around /v1/images/edits |
Yes; nothing from inside vLLM-Omni | Yes; the external provider is a black box |
| Memory | PowerContext spans, or the demo app's timing of the run | If PowerContext traces | The same |
Drawn, not embedded. The demo application queries Jaeger (/api/v3/traces for the
window, /api/traces/{id} for one trace [N28]) with fixed queries and draws rows. Jaeger's
own interface shows one trace at a time and is not published; the presenter can open it
by port-forward.
Cost and the Local switch. Jaeger requests 256 Mi in Cloud and 128 Mi in Local, where
its store holds 2000 traces; it used 30 to 48 Mi in the probe [N27]. In Local tracing
is off by default (owner decision, 2026-11-27): Jaeger and the gateway policy are not
installed, PowerContext and the demo application find no tracing ConfigMap and do not
trace, and the trace view shows the application's own stage timings.
make <target> PROFILE=local TRACING=on adds them. In Cloud tracing is always on. The
virtual test renders both ways [N47].
11. The stage camera and the vote¶
Where the camera is¶
The camera is an ordinary USB or built-in camera on a machine on stage. The camera tool runs on that machine, as a native process, because that is where the device is.
| Local | Cloud | |
|---|---|---|
| The stage machine | The Mac Mini itself: it is the cluster's host and it is in the room | A laptop on stage; the cluster is in a data centre |
| How the gateway reaches the tool | host.orb.internal, the Mac as seen from the OrbStack machine, the way it reaches the model server. Probed with a stand-in [N9] |
Through an outbound tunnel the laptop opens, as a TLS target. Untried [N11] |
| How the frame reaches the cluster | An HTTPS upload to the demo's public URL | The same |
| Why not a pod | A pod in the OrbStack machine has no path to the Mac's camera that was tried [N50]; the GPU is the same story [K1] | The cluster is not in the room |
The tool¶
One tool, one frame, no streaming:
- The gateway forwards the agent's call, adding the key the tool expects.
- The tool opens the configured camera, discards the first frames while exposure settles, takes one, scales it to at most 1536 px on the long side, and encodes it as JPEG, the limits audience uploads have. Proposed hard limit: 1 MB; a frame of that size is typically 200 to 500 kB (estimate).
- It uploads the frame to
POST /api/frameson the demo's public URL with a presenter-only key. The demo application stores it under the same rules as an audience upload, attaches it to the stage job that is waiting for one, and puts it into that job's sandbox. - The tool returns the reference and facts above, as text, and keeps nothing.
Why the frame does not come back in the tool result: the result goes to the model, which is text-only, and a picture would only fill its context. Why it goes through the public entry: it is then literally the path an audience photo takes, with the same limits, storage, retention and privacy rules, and the fallback (the presenter's phone) uses the same endpoint. Both the call and the upload pass through Agentgateway.
The tool answers with plain JSON and keeps no session, so that it also works through a tunnel that does not carry event streams [L22, N9].
No vision-language model is added. Nothing looks at the frame except the image-editing model. The GPU budget stays at 43 of 48 GiB.
The vote¶
No model is involved.
- The choices are a short, fixed list prepared before the show (proposed: three): a label for the button and an instruction for the agent, for example "Flying" and "make everyone fly". Each instruction is tried in rehearsal.
- Collecting. The phone page shows one button per theme. A tap sends
POST /api/vote; the demo application keeps one vote per browser session, in memory, and a later tap changes it. The vote is open from the moment the presenter opens it until the presenter closes it (proposed: 25 s). - Deciding. The theme with the most votes wins. A tie goes to the theme that reached that count first. With no votes, the first theme wins.
- Showing. The big screen draws the bars from the application's tally over its WebSocket.
- Becoming the instruction. The winning theme's instruction is the stage job's instruction, prefixed with the request to take the picture. From there it is an ordinary job: the agent plans the prompt as it would for a typed instruction.
- Not a security matter. One vote per browser session can be gamed by clearing cookies. The worst outcome is another of three prepared themes.
12. When something fails: the ladder, the recorded run, rehearsal¶
The ladder¶
In order; each step keeps as much of the show live as it can.
- One job fails: the screen says which step failed; the presenter moves on. One automatic retry at most.
- The camera fails (Act 1): the presenter uploads a photo of the room from the stage phone to the endpoint the camera tool uses; the job continues.
- The image model fails (Cloud): switch the
image-editroute to the external API, a prepared manifest; say that the edit now leaves the cluster. - The agent loop fails (the harness, or the model stops calling tools): Act 1 and the close show the images prepared in rehearsal, labelled; Act 3 (a) and (b) still run live, because neither needs the agent.
- Tracing fails: the trace view shows the application's own timings, labelled.
- The public entry fails: the presenter's hotspot phone is the audience; Act 3 (a) is run from that one phone.
- The cluster fails: the recorded run.
The recorded run¶
Record one complete run in rehearsal: both screens and a phone, all three acts and the close. The big-screen page has a replay mode that plays the stored results and their recorded events in the order of the script, labelled "recorded" on every view. It is the last step of the ladder, and it is never presented as live.
Rehearsal checklist¶
The day before, on the real setup:
- The stage job, three times in a row, with each theme. Note the time of each step.
- The follow-up ("more dramatic") after each. This is where memory is first tried.
- The camera: framing, light, the first-run permission prompt of the operating system answered, the frame's size on disk.
- The camera tool stopped, and the stage job run again: time until the screen asks for a photo; the upload from the stage phone.
- Ten phones through Act 2 at once: queue behaviour, the wall, approval by the operator.
- The tap, with the phones available: how many it takes to exceed the limit; set the limit so that the expected room exceeds it several times over; check the stage phone alone exceeds it.
- The drill as on stage: the gateway answers
403, its refused-egress counter goes up, the receiver's counter is 0. Then the reachability check (http://egress-check.invalid/from a sandbox returns200) and a direct request that ignores the proxy, which must fail. Then the control with theNetworkPolicyremoved: the direct request gets out. Then the policy is put back and confirmed (make verify). - The first turn of a fresh harness runtime, timed, three times: it must be about a second, not twenty [P8].
- The trace of the stage job: every row present; without tracing (Local's default), the fallback.
- Each step of the ladder, once.
- The whole script against a clock. Cut Act 2 first if it runs over.
- Record the run.
On the day, before the doors open:
- The QR code from mobile data and from the venue Wi-Fi.
-
tools/listthrough the gateway shows three tools. If the camera cannot be reached and cannot be fixed, remove its target and plan Act 1 with the stage phone: a camera that does not answer slows every agent session [N10]. - One stage job. The drill counter at 0. Jaeger holds the trace.
- The Mac (Local) is doing nothing else.
- Purge.