Skip to content

guest-agent: remove EmitEvent API#768

Merged
kvinwang merged 2 commits into
masterfrom
remove/guest-agent-emit-event
Jul 12, 2026
Merged

guest-agent: remove EmitEvent API#768
kvinwang merged 2 commits into
masterfrom
remove/guest-agent-emit-event

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

Summary

Remove the guest-agent EmitEvent RPC and matching SDK wrappers.

  • Not portable across TEEs: the API is TDX-centric (extend RTMR3). Other platforms and the guest-agent simulator cannot implement it faithfully.
  • Rare real-world use: applications almost never need app-level RTMR extension via the socket API; boot measurements already go through emit_runtime_event inside dstack-util.
  • Simulator / multi-TEE friction: the simulator could only refuse the call, which made SDK demos and tests awkward and encouraged a TDX-only surface on a multi-TEE stack.

Boot-time RTMR/PCR extension via dstack_attest::emit_runtime_event (used by dstack-util system setup) is unchanged. Apps that still need extra runtime measurements should use native TDX/TSM measurement interfaces and own their event-log story.

Changes

  • Proto: drop rpc EmitEvent and EmitEventArgs
  • guest-agent / simulator: drop PlatformBackend::emit_event and RPC handler
  • SDKs: remove emit_event / EmitEvent / emitEvent from Rust, Python, Go, JS
  • Docs: curl API, native TEE interfaces, security model, SDK READMEs

Test plan

  • cargo test -p dstack-guest-agent -p dstack-guest-agent-simulator (26 tests pass)
  • cargo check -p dstack-guest-agent -p dstack-guest-agent-simulator -p dstack-sdk
  • cargo fmt --check
  • go build ./dstack/ in sdk/go
  • Confirm no remaining production callers of /EmitEvent (expected: none or rare)

The RPC only meaningfully works on TDX (RTMR3 extension), is rarely used,
and cannot be implemented faithfully in the simulator or across TEEs. Apps
that need extra runtime measurements should use native TEE interfaces.
Keep emit_runtime_event for guest boot measurements in dstack-util.
Copilot AI review requested due to automatic review settings July 12, 2026 03:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the guest-agent EmitEvent RPC and all corresponding SDK wrappers and documentation, aligning the public surface area with a multi-TEE design and avoiding a TDX-centric runtime-measurement API.

Changes:

  • Deleted EmitEvent from the guest-agent proto/service and removed backend + RPC handler plumbing (including simulator behavior/tests).
  • Removed emit_event / EmitEvent / emitEvent from Rust, Python, Go, and JS SDKs (plus examples and SDK docs).
  • Updated security and native-interface docs (and curl API docs) to reflect that runtime measurements should be done via native TDX/TSM interfaces.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/rust/src/dstack_client.rs Removes Rust SDK emit_event wrapper calling /EmitEvent.
sdk/rust/README.md Removes Rust SDK documentation for event emission.
sdk/rust/examples/dstack_client_usage.rs Removes emit-event usage from example flow.
sdk/python/tests/test_typing.py Updates typing expectations to drop emit_event.
sdk/python/tests/test_client.py Removes emit_event tests and simulator-specific behavior assertions.
sdk/python/src/dstack_sdk/dstack_client.py Removes async + sync emit_event client methods.
sdk/python/README.md Removes Python docs and feature-matrix entry for emit_event.
sdk/js/src/index.ts Removes JS SDK emitEvent implementation.
sdk/js/README.md Removes JS docs and feature-matrix entry for emitEvent.
sdk/go/README.md Removes Go SDK event logging documentation and API reference for EmitEvent.
sdk/go/dstack/client.go Removes Go SDK EmitEvent method implementation.
sdk/curl/api.md Removes /EmitEvent endpoint docs and renumbers subsequent sections.
guest-agent/src/rpc_service.rs Drops EmitEvent RPC handler and associated state/backends wiring.
guest-agent/src/backend.rs Removes PlatformBackend::emit_event and RealPlatform implementation.
guest-agent/rpc/proto/agent_rpc.proto Deletes rpc EmitEvent and EmitEventArgs message from the service definition.
guest-agent-simulator/src/main.rs Removes simulator-side emit_event rejection and its test; cleans imports accordingly.
dstack-attest/src/lib.rs Updates concurrency docs to remove reference to concurrent emit_event RPC calls.
docs/security/security-model.md Updates security-model narrative to remove “application-emitted events” from RTMR3 description.
docs/native-tee-interfaces.md Updates guidance to steer apps toward native measurement interfaces instead of /EmitEvent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ruff flagged httpx and redundant local os imports left after removing
the emit_event tests.
@kvinwang
kvinwang merged commit c9191c9 into master Jul 12, 2026
15 checks passed
@kvinwang
kvinwang deleted the remove/guest-agent-emit-event branch July 20, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants