Skip to content

Commit b362ecf

Browse files
committed
Consolidate demo agent runtime lifecycle
1 parent fb07ee0 commit b362ecf

6 files changed

Lines changed: 538 additions & 513 deletions

File tree

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,26 @@ After setup, prompt the demo agent:
5151
--prompt "Access https://docstore/documents using curl"
5252
```
5353

54-
On later runs, start the gateway first and use `./demo/demo-agent.sh prompt`. `./demo/connect.sh` prepares `machine-client.pem` for the current simulated TPM key and identity extension whenever it prepares or starts the sidecar. `--regenerate-certs` creates a fresh simulated TPM state; any permissions for the old subject key will no longer match.
54+
On later runs, start the gateway first and use `./demo/demo-agent.sh prompt`.
55+
`./demo/demo-agent.sh` prepares `machine-client.pem` for the current simulated
56+
TPM key and identity whenever it creates or restarts the local sidecar runtime.
57+
Delete the demo agent when finished; this stops the local sidecar and `swtpm`,
58+
revokes its database permissions, and removes local state:
5559

56-
Pass a custom policy extension value: `./demo/connect.sh start-sidecar ... --extension-value agent-beta`. The extension value must match `permission_registry.subject_identity` in an active signed permission row.
60+
```bash
61+
./demo/demo-agent.sh delete agent-alpha
62+
```
63+
64+
Pass a custom policy identity when creating an agent with
65+
`./demo/demo-agent.sh create --identity agent-beta ...`. The identity must match
66+
`permission_registry.subject_identity` in an active signed permission row.
5767

5868
The simulated TPM state lives under `$AGENT_STATE/client/swtpm/`. By default,
5969
the sidecar uses TCTI `swtpm:host=127.0.0.1,port=2321` and persistent handle
60-
`0x81010004`; override the handle or simulator data port with
61-
`./demo/connect.sh start-sidecar --tpm-handle` and
62-
`--swtpm-port`. The swtpm control port is always the data port plus one, which
63-
matches the TSS swtpm TCTI convention.
70+
`0x81010004`; override the simulator data port with
71+
`AGENT_GATEWAY_DEMO_SWTPM_PORT` and the handle with
72+
`AGENT_GATEWAY_DEMO_TPM_HANDLE`. The swtpm control port is always the data port
73+
plus one, which matches the TSS swtpm TCTI convention.
6474

6575
## Configuration
6676

@@ -143,6 +153,9 @@ AGENT_HANDLE="$(./demo/demo-agent.sh create \
143153
# Principal shell: send the first prompt through that agent.
144154
./demo/demo-agent.sh prompt "$AGENT_HANDLE" \
145155
--prompt "Access https://docstore/documents with curl."
156+
157+
# Principal shell: delete the agent when finished.
158+
./demo/demo-agent.sh delete "$AGENT_HANDLE"
146159
```
147160

148161
## Authorization Registry
@@ -169,6 +182,10 @@ The authorization registry has three main tables:
169182

170183
The signed bytes are the following UTF-8 text, with fields in this exact order and timestamps formatted as UTC RFC 3339 with six fractional digits:
171184

185+
`./registry-cli/agent-permissions.sh grant` inserts signed agent permission rows,
186+
and `./registry-cli/agent-permissions.sh delete` revokes rows for an agent
187+
identity and subject public key.
188+
172189
```text
173190
agent-gateway-permission-v1
174191
permission_id=perm-1

0 commit comments

Comments
 (0)