feat(temporal): add worker-side payload encryption#2297
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
c5e5d08 to
35c2788
Compare
2e221d2 to
b356b85
Compare
35c2788 to
2ad828b
Compare
b356b85 to
d1915a5
Compare
d1915a5 to
b367063
Compare
This comment has been minimized.
This comment has been minimized.
|
✅ No security or compliance issues detected. Reviewed everything up to 7b894af. Security Overview
Detected Code ChangesThe diff is too large to display a summary of code changes. |
jordan-umusu
left a comment
There was a problem hiding this comment.
LGTM with a few nits and two concerns:
- K8s coming separately?
- What does the rollout for this look like?
096d008 to
c49c534
Compare
yes, internal PR
merge first with encryption disabled, then we enable it afterwards. this is safe because the codec can handle both encrypted and non-encrypted Payloads simultaneously |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c49c5348d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c760b22af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Found 1 test failure on Blacksmith runners: Failure
|
jordan-umusu
left a comment
There was a problem hiding this comment.
LGTM once CI passing

Checklist
uv run pytest tests)?pre-commit run --all-files)?Description
This PR adds worker-side Temporal payload encryption without relying on an external codec server. When enabled, the Temporal data converter composes compression with AES-GCM encryption, scopes keys by workspace, and keeps decode marker-driven so historical payloads remain readable across configuration changes.
Today's updates refine the rollout shape:
Related Issues
N/A
Screenshots / Recordings
N/A. Backend, Temporal, and infrastructure change only.
Steps to QA
uv run pytest tests/unit/test_temporal_codec.py tests/unit/test_dsl_converter.py tests/temporal/test_workflow_timers.py.uv run ruff check tracecat/temporal/codec.py tracecat/dsl/common.py tracecat/config.py tracecat/api/app.py tests/unit/test_temporal_codec.py tests/unit/test_dsl_converter.py tests/temporal/test_workflow_timers.py.uv run basedpyright tracecat/temporal/codec.py tracecat/dsl/common.py tracecat/config.py tracecat/api/app.py.Summary by cubic
Adds worker-side, fail-open AES‑GCM encryption for Temporal payloads with per-workspace keys and marker-driven decode; no codec server required. Off by default; enable with
TEMPORAL__PAYLOAD_ENCRYPTION_ENABLED=trueand provide a keyring viaTEMPORAL__PAYLOAD_ENCRYPTION_KEYRINGorTEMPORAL__PAYLOAD_ENCRYPTION_KEYRING_ARN.New Features
ctx_role.workspace_id(falls back to__global__).asyncio.to_thread);cachetoolsTTL cache with configurable TTL/max items; memoized codec factory with test reset helpers.decode_payloads; uses encoded‑attributes failure converter when encryption is enabled; agent/child memo parsing is async and tolerant.temporal_payload_encryption_keyring_arn; scope Temporal secrets to worker/agent tasks; Docker Compose exposes encryption env vars; new Fargate vars for cache TTL/max items; removed codec server endpoint.Bug Fixes
UnreadableTemporalPayloadplaceholder (includes encoding and size) in histories and compact views instead of raising; skip trigger context resolution for these; update client schemas/types to accept the placeholder.Written for commit 7b894af. Summary will update on new commits.