> For the complete documentation index, see [llms.txt](https://faction-os.gitbook.io/faction-os-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/sessions/phase20-session08-managed-agent-lifecycle-control/security-compliance.md).

# Security & Compliance Report

**Session ID**: `phase20-session08-managed-agent-lifecycle-control` **Package**: null (cross-cutting) **Reviewed**: 2026-06-28 **Result**: PASS

## Scope

**Files reviewed** (session deliverables and touched support files only):

* `apps/server/src/managers/managedAgentSessionManager.ts` - Managed process and PTY lifecycle control.
* `apps/server/tests/managedAgentSessionManager.test.ts` - Managed session manager coverage.
* `packages/protocol/src/orchestrationCommandCenter.ts` - Managed lifecycle protocol fields, parser validation, and blocked-field vocabulary.
* `packages/protocol/src/rest.ts` - Managed lifecycle REST request alias.
* `packages/protocol/tests/orchestrationCommandCenter.test.ts` - Protocol managed lifecycle coverage.
* `apps/server/src/lib/commandCenterValidation.ts` - Managed lifecycle route validation.
* `apps/server/src/managers/heroLifecycleManager.ts` - Lifecycle command persistence and observed-only fallback.
* `apps/server/src/managers/orchestrationCommandCenter.ts` - Managed execution routing, execution runs, and compact events.
* `apps/server/src/routes/commandCenter.ts` - Hero lifecycle route and in-flight mutation guard.
* `apps/server/src/routes/event.ts` - Hook-observed lifecycle record-only behavior.
* `apps/server/src/server.ts` - Managed manager construction and disposal.
* `apps/server/tests/heroLifecycleManager.test.ts` - Lifecycle manager behavior and privacy coverage.
* `apps/server/tests/commandCenterValidation.test.ts` - Route validation and blocked raw-field coverage.
* `apps/server/tests/commandCenterRoutes.test.ts` - Route execution, event privacy, stale, and duplicate coverage.
* `apps/server/tests/eventIngest.test.ts` - Hook-observed record-only coverage.
* `apps/web/src/lib/orchestrationApi.ts` - Managed lifecycle request client and response validation.
* `apps/web/src/lib/commandCenterUi.ts` - Managed lifecycle UI labels, availability, and redaction.
* `apps/web/src/components/orchestration/HeroLineageWorkbench.tsx` - Hero/Lineage managed controls and message input.
* `apps/web/src/components/orchestration/OrchestrationShell.tsx` - Managed lifecycle submit wiring.
* `apps/web/src/store/useWsClient.ts` - Managed lifecycle WebSocket sanitization.
* `apps/web/tests/orchestrationApi.test.ts` - Managed lifecycle request/response client coverage.
* `apps/web/tests/commandCenterUi.test.ts` - Managed versus observed label and redaction coverage.
* `apps/web/tests/HeroLineageWorkbench.test.tsx` - Managed control rendering coverage.
* `apps/web/tests/CommandCenterPanes.test.tsx` - Command-center heroes tab integration coverage.
* `apps/web/tests/commandCenterStore.test.ts` - WebSocket/store sanitization coverage.
* `tests/e2e/orchestration-command-center.e2e.ts` - Browser managed stop and privacy proof.
* `apps/server/README_server.md` - Managed lifecycle ownership and privacy docs.
* `apps/web/README_web.md` - Hero/Lineage managed control and privacy docs.
* `docs/api/README_api.md` - Managed lifecycle REST/WebSocket API docs.

**Review method**: Static analysis of session deliverables and touched support files, targeted security keyword scan, process/control API inspection, focused/full automated tests, Playwright browser proof, and repository secret scan.

**Review evidence**:

* Command/check: `npm run security:secrets`
  * Result: PASS
  * Evidence: Secret scan passed; 1978 tracked text files checked.
* Command/check: `git diff --name-only HEAD | rg '(^|/)package(-lock)?\.json$'`; `git ls-files --others --exclude-standard | rg '(^|/)package(-lock)?\.json$'`
  * Result: N/A
  * Evidence: No dependency manifest or lockfile changes; dependency audit for new packages is not applicable.
* Command/check: `rg -n '\b(secret|token|password|api[_-]?key|private key|BEGIN [A-Z ]+ KEY|rawCommand|rawOutput|providerPayload|transcript|terminal output|absolute path)\b' $changed_files`
  * Result: PASS
  * Evidence: Matches were redaction helpers, blocked-field tests, documentation of blocked payloads, or tests asserting sensitive values are not emitted. No hardcoded credentials were found.
* Command/check: `rg -n 'killProcessTree|\.kill\(|writeInput\(|restart\(|spawn\(|exec\(|eval\(|new Function|setTimeout|inFlight|idempotency|expectedRevision|messageInput' $runtime_files`
  * Result: PASS
  * Evidence: Process and PTY control is limited to registered managed sessions, bounded with in-flight/idempotency guards, revision preflight, timeout-bounded stop, explicit unavailable/failure states, and request-scoped message input.
* Command/check: `npx vitest run packages/protocol/tests/orchestrationCommandCenter.test.ts apps/server/tests/managedAgentSessionManager.test.ts apps/server/tests/heroLifecycleManager.test.ts apps/server/tests/commandCenterValidation.test.ts apps/server/tests/commandCenterRoutes.test.ts apps/server/tests/eventIngest.test.ts apps/web/tests/orchestrationApi.test.ts apps/web/tests/commandCenterUi.test.ts apps/web/tests/HeroLineageWorkbench.test.tsx apps/web/tests/CommandCenterPanes.test.tsx apps/web/tests/commandCenterStore.test.ts`
  * Result: PASS
  * Evidence: 11 files passed; 146 tests passed after the validation-time duplicate-trigger test harness fix.
* Command/check: `npm run test:e2e -- --project=app-desktop tests/e2e/orchestration-command-center.e2e.ts`
  * Result: PASS
  * Evidence: 6 browser tests passed, including managed stop in Hero/Lineage without raw command, terminal output, transcript, broad path, token, or provider payload leakage.

## Security Assessment

### Overall: PASS

| Category                      | Status | Severity | Details                                                                                                                                                                               |
| ----------------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Injection (SQLi, CMDi, LDAPi) | PASS   | --       | No SQL/database layer introduced. No new arbitrary command execution path; process control is limited to manager-registered process handles or PIDs and PTY sessions.                 |
| Hardcoded Secrets             | PASS   | --       | Repository secret scan passed. Targeted keyword matches were redaction helpers, tests, or docs; no real credential was added.                                                         |
| Sensitive Data Exposure       | PASS   | --       | Broad REST, WebSocket, docs, tests, and UI rows expose compact managed session ids, provider labels, readiness, supported actions, execution ids, and redacted result summaries only. |
| Insecure Dependencies         | PASS   | --       | No dependency manifest or lockfile changes.                                                                                                                                           |
| Security Misconfiguration     | PASS   | --       | No CORS, auth, hosted, Worker, analytics, remote execution, or debug-mode configuration changes.                                                                                      |
| Database Security             | N/A    | --       | Project conventions state database is not configured; spec excludes database, persistence schema, and migration work.                                                                 |

### Security Findings

No security findings.

## GDPR Compliance Assessment

### Overall: N/A

*N/A because this session introduced no personal data collection, consent flow, user account storage, third-party transfer, analytics, hosted persistence, or database-backed profile data. Managed lifecycle data remains local command-center operational metadata and request-scoped message input is not persisted in lifecycle rows.*

**Categories reviewed**: Data Collection & Purpose, Consent Mechanism, Data Minimization, Right to Erasure, PII in Logs, Third-Party Data Transfers.

### Personal Data Inventory

No personal data collected or processed in this session.

### GDPR Findings

No GDPR findings.

## Recommendations

None -- session is compliant.

## Sign-Off

* **Result**: PASS
* **Reviewed by**: AI validation (validate)
* **Date**: 2026-06-28


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/sessions/phase20-session08-managed-agent-lifecycle-control/security-compliance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
