fix(agent-access): harden ssh-agent session lifecycle #678
No reviewers
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pdurlej/platform!678
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "codex/79-agent-access-session-lifecycle"
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?
Canary status: missing - fire canary 3+3 manually before merge
Summary
Hardens the Codex OpenClaw SSH agent wrapper for issue #79 without touching live SSH, RS2000, Forgejo, Infisical, or production keys.
This PR intentionally uses
Refs #79, notCloses #79: the issue's own AC requires f2 after 7 days of real TTL evidence, so full closure would be a false-green.Refs #79
Canary Context Pack
Product story
Codex/OpenClaw SSH access should be auditable and fail closed. The operator should be able to inspect session lifecycle evidence without exposing private key material or trusting stale runtime directories.
What changed
audit.jsonllifecycle events for created/key_loaded/stopped/crashed.--list --jsonwith duration and exit-reason fields.codex-openclaw-ssh-agent-ttl-evidencefor TTL evidence summaries.Why it changed
Issue #79 requires stronger lifecycle hardening and queryable evidence before any future TTL reduction decision.
Files touched
scripts/agent-access/codex-openclaw-ssh-agentscripts/agent-access/codex-openclaw-ssh-agent-ttl-evidencecontrol-plane/platformctl/tests/test_agent_access_ssh_agent.pydocs/agent-access/codex-openclaw-ssh.mdRelevant context
docs/specs/agent-access-session-lifecycle-hardening-v0/01-specify.mddocs/specs/agent-access-session-lifecycle-hardening-v0/02-plan.mddocs/specs/agent-access-session-lifecycle-hardening-v0/03-tasks.mddocs/agent-access/codex-openclaw-ssh.mdRuntime evidence
No live runtime action was performed. Verification used fake OpenSSH tools and disposable runtime roots only.
Known constraints
This does not make the f2 TTL reduction decision. That still needs 7+ days of real evidence.
Explicit out-of-scope
Requested decision
Review whether this safely lands e1/e2/f1 groundwork for #79.
Merge blockers
Spec sources read
docs/specs/agent-access-session-lifecycle-hardening-v0/01-specify.md- acceptance criteriadocs/specs/agent-access-session-lifecycle-hardening-v0/02-plan.md- design choicesdocs/specs/agent-access-session-lifecycle-hardening-v0/03-tasks.md- slice tasks and sequencingdocs/agent-access/codex-openclaw-ssh.md- operator-facing runbookscripts/agent-access/codex-openclaw-ssh-agent- implementation surfacecontrol-plane/platformctl/tests/test_agent_access_ssh_agent.py- regression surfaceValidation
uv run pytest control-plane/platformctl/tests/test_agent_access_ssh_agent.py- 22 passedPYTHONPATH=control-plane uv run --project control-plane python -m platformctl.cli validate all --json- exitCode 0python3 -m py_compile scripts/agent-access/codex-openclaw-ssh-agent scripts/agent-access/codex-openclaw-ssh-agent-ttl-evidence- passedNotes
uvrefreshed trackedcontrol-plane/platformctl.egg-info/*files in the local worktree during validation, but those generated changes are intentionally unstaged and not part of this PR.Patchwarden PR sanity
eligible_sanity_clean678a0696244954f581070ce2a6dc67879b3af5b171cpresentDeterministic findings
No deterministic findings.
Model reviewers
global-glm/glm-5.1:cloudStatus:
okVerdict:
OKlowUnnecessary exception handler in write_audit_event is dead codescripts/agent-access/codex-openclaw-ssh-agent lines ~195-198:except Exception: raiseis a no-op that adds noise without changing control flowlowTOCTOU window between os.mkdir and post-creation validationscripts/agent-access/codex-openclaw-ssh-agent_ensure_parent_existsandcreate_private_session_dir: os.mkdir at mode 0o700 is followed by_path_is_owned_and_privatecheck, but an attacker with write access to parent could replace theglobal-deepseek/deepseek-v4-pro:clouderror-redteam/kimi-k2.6:clouderror-Policy notes
PLATFORMCTL_PR_SANITY_REDTEAM_MODELis configured.