fix(agent-access): session lifecycle hardening after ssh-agent TTL slice #79
Labels
No labels
W6d-automerge-calibration
agent/claude-code
agent/codex
agent/hermes
agent/iskra
agent/ollama
agent/patchwarden
automerge-candidate
class/security-sensitive
cutover-gate
dependency/blocked
dependency/blocks-others
dependency/cross-repo
dependency/needs-confirmation
domain:agents
domain:ci
domain:docs
domain:forgejo
domain:infra
domain:memory
domain:runtime
domain:signal
domain:ux
flow/architecture
flow/blocked
flow/deployed
flow/done
flow/implementation
flow/intake
flow/maintained
flow/observed
flow/ready
flow/refining
flow/retired
flow/review
iterating
judge/codex-candidate
judge/hermes-candidate
judge/low-confidence
judge/needs-refinement
judge/operator-needed
judge/p0
judge/p1
judge/p2
judge/p3
judge/park
judge/patchwarden-candidate
judge/stale-priority
kind/adr
kind/bug
kind/chore
kind/feature
kind/infra
kind/ops
kind/refactor
kind/research
large-impact
merge/auto
merge/manual
merge/manual-dependency-conflict
merge/manual-failing-tests
merge/manual-merge-conflict
merge/manual-missing-review
merge/manual-operator-preference
merge/manual-red-zone
merge/manual-security-sensitive
merge/manual-unclear-scope
merge/manual-unknown
meta
mode:operator-only
mode:patchwarden-iskra-approved
mode:safe-auto
needs-operator-decision
needs-triage
not-ready
observed/erroring
observed/needs-followup
observed/pending
observed/retire-candidate
observed/unused
observed/used
operator-emotional
owner-attention
phase/02
phase/03
priority:p0
priority:p1
priority:p2
priority:p3
proposed
ready-for-agent
ready-for-operator
recovery
review:claude-reviewed
review:codex-reviewed
review:dziadek-reviewed
review:needs-human
risk/exposure
risk/process
risk/product
risk/runtime
safety:external-write
safety:no-prod-mutation
safety:prod-impact
safety:secret-touch
size/large
size/medium
size/small
size/tiny
size/unknown
source/adr
source/agent-generated
source/manual
source/operator-chat
source/voice-note
status:blocked
status:codex-ready
status:merged:pending-evidence
status:needs-evidence
status:operator-needed
status:parked
tier/full
tier/lite
tier/stacked
tier:0-platform-substrate
tier:1-iskra-value-layer
tier:2-tools-products-modules
type:bug
type:chore
type:docs
type:feat
type:policy
type:research
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pdurlej/platform#79
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Follow-up from PR #77 canary iter2/iter3. #77 now has working Infisical injection, live forced-command SSH smoke, and
--stop <session-id>revoke. Remaining findings are lifecycle hardening, not the initial access-path blocker.Scope
Harden
scripts/agent-access/codex-openclaw-ssh-agentsession lifecycle after #77 lands.Tasks
--listto show session id, capability, expires_at, stopped/alive/expired status.parse_agent_output/ post-start error cleanup so started agents are killed on every startup failure path.Acceptance criteria
Related
Fork A1 prebuild landed — PR #365
Session lifecycle hardening v0 prebuild opened as part of 2026-05-18 retry batch (worktree-isolated, no shared-checkout collision).
Spec Kit scope: closes the remaining 2 of 6 tasks from #79 (runtime dir race + TTL evidence-driven reduction) plus adversarial test surface. 4/6 tasks already shipped: --list (
eca015a), --prune (f269673), signal block, startup cleanup (a39c3af).Next: codex implements slices e1 → e2 → f1 → f2 per PR #365 spec. Closing #79 follows slice f2 merge.
M03 triage result: moved out of Secrets closeout.
Reason: this is ssh-agent session lifecycle hardening after the agent-access slice, not the current secret-source hardening lane. It belongs with agent execution / CI governance.
Disposition: move to M06. It remains security-sensitive because it touches SSH agent capability lifecycle and key handling behavior. No code/runtime mutation was performed.
Architectural guidance (claude) — session lifecycle hardening. Risk class: a stale/leaked ssh-agent session outliving its scope. Pattern to consider (not prescriptive): bind each agent-access session to (a) a short TTL, (b) the approval context — reuse ACTOR-ID-01 (#190): actor + PR head SHA, (c) explicit teardown on task end. This is one slice of the Agent Access Plane (#76); it can ship independently of the full ADR. Security-sensitive → smallest coherent PRs + full canary. Execution details are yours.
Closing as satisfied on current main.
Evidence checked by codex:
scripts/agent-access/codex-openclaw-ssh-agentalready supports--list,--list --json,--prune, private runtime/session dirs, signal cleanup, post-start cleanup, and safe stopped/expired pruning.docs/agent-access/codex-openclaw-ssh.mddocuments listing/pruning and private runtime directory behavior.control-plane/platformctl/tests/test_agent_access_ssh_agent.pycovers list, prune, unsafe dir refusal, post-start cleanup, signal cleanup, no private key leakage, and real OpenSSH TTL eviction with disposable keys.Validation run:
PYTHONPATH=control-plane python3 -m pytest control-plane/platformctl/tests/test_agent_access_ssh_agent.py-> 22 passed.PYTHONPATH=control-plane python3 -m platformctl.cli validate all --json-> exitCode 0.Note: the real OpenSSH test must run outside the Codex filesystem sandbox on macOS, because sandboxed
ssh-agent -a <tmp-socket>cannot bind the Unix socket and returnsOperation not permitted. It passes outside that sandbox and in the intended runner/runtime environment.