fix(orchestration): address code review findings#48
Open
Conversation
… scoping, active-run tracking
- SSRF prevention: http_webhook adapter blocks private/loopback URLs (RFC-1918,
169.254/16, 0.0.0.0/8, localhost, metadata.google.internal) with opt-out via
`allow_private_urls = "true"` in integration config
- Secret scoping: adapter dispatch now filters tenant secrets to only those
referenced via {secret:KEY} in integration config (was leaking full vault)
- Remove `args` splitting in claude_code + codex adapters (command injection risk)
- Add `agent.wait` signal to openclaw adapter after sending agent request
- Organization spec: IncrementActiveRuns / DecrementActiveRuns actions with
active_runs > 0 guard; ResetBudgetCycle now accepts budget_consumed_cents param
- CSDL: fix BudgetLedger AmountCents/Tokens Edm.String → Edm.Int64; add new
action bindings for IncrementActiveRuns, DecrementActiveRuns, ResetBudgetCycle
- Cedar: restrict Organization create to supervisor/human; permit new run-count
actions alongside RecordCost for any principal
- DST: consolidate determinism-ok annotations inline; use BTreeMap for secrets
- Tests: orchestration_e2e.rs — 6 integration tests covering full HeartbeatRun
lifecycle, adapter failure path, Organization full lifecycle, BudgetLedger
recording, guard enforcement, and cancellation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6 tests covering the full agent-orchestration app lifecycle: - HeartbeatRun: Schedule → ApproveBudget → CheckIn → StartExecution → adapter callback → Complete - HeartbeatRun: adapter failure triggers Fail callback - HeartbeatRun: guard blocks CheckIn without budget approval - HeartbeatRun: Cancel from Working state - Organization: full lifecycle including active run tracking - BudgetLedger: cost entry recording Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Cedar engine was only creating a principal entity in the entity store, but not a resource entity. This meant Cedar policies using `resource.Field` expressions (e.g. `resource.AgentId == principal.id`) always failed because the resource entity had no attributes to resolve. Now both the principal and resource entities are added to the entity store with their respective attributes, enabling `resource.X` references in Cedar policies to work correctly. Verified end-to-end: started local Temper, installed agent-orchestration app, and walked HeartbeatRun through full lifecycle via HTTP API with Cedar authorization passing for all role-gated actions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses all 11 findings from the agent-orchestration code review (PR #37):
Critical fixes (C1–C5):
argsconfig key from ClaudeCode/Codex adapters (command injection surface)allow_private_urlsescape hatch for testingturn_cost_centsandtokens_consumedparams to CSDLRecordTurnbudget_consumed_centsparam to CSDLRecordCostAmountCents/TokensfromEdm.StringtoEdm.Int64Important fixes (I1–I6):
createCedar permit for Organization (supervisor/human only)IncrementActiveRuns/DecrementActiveRunsto Organization spec + CSDL + Cedaragent.waitmessage to OpenClaw adapter per protocol spec// determinism-okannotations to all adapterInstant::now()calls{secret:KEY}in integration configResetBudgetCycleto acceptbudget_consumed_centsparam for resetTests:
Test plan
allow_private_urlsconfigcargo test --workspace— all tests pass🤖 Generated with Claude Code