> 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/phase03-session04-guarded-local-action-runtime/security-compliance.md).

# Security and Compliance Notes

**Session ID**: `phase03-session04-guarded-local-action-runtime` **Package**: Cross-cutting (`packages/protocol`, `apps/server`, `apps/cli`) **Started**: 2026-05-29 12:50 **Last Updated**: 2026-05-29 13:31

***

## Scope

This session adds local guarded-action contracts, server state, routes, WebSocket decisions, CLI helper calls, tests, and docs. It must preserve local-first defaults and avoid hidden filesystem, git, terminal, remote, or container execution.

## Initial Posture

* No hosted service credentials are required.
* No database or durable hosted store is introduced.
* New state is expected to remain local, in-memory, bounded, and redacted at HTTP, WebSocket, CLI, docs, and validation boundaries.
* Unsupported file, git, terminal, remote-access, and container surfaces must continue to fail closed with deterministic capability responses.

## Findings

* Guarded-action state is local, in-memory, bounded, and non-durable.
* No filesystem, git, terminal, remote-access, or container side effects are executed by the new runtime.
* Approved actions without an explicit safe local executor return compact unavailable results.
* Guarded-action HTTP routes inherit existing local auth, CORS, rate-limit, body-size, and loopback defaults.
* WebSocket guarded-action decisions are schema-validated and duplicate-suppressed per socket lifecycle.
* Proposal text is redacted before storage and broad update frames omit rationale, preview, command bodies, file contents, terminal output, tokens, transcript paths, and absolute paths.
* CLI helper output sanitizes compact errors and rejects non-loopback server URLs.

## Validation

* Focused typechecks passed for `packages/protocol` and `apps/server`.
* Focused protocol, server, WebSocket, auth-boundary, unsupported-route, and CLI helper tests passed.
* Biome, ASCII/LF, and patch hygiene checks passed for touched files.

## Remaining Risks

* Unified erasure for new in-memory guarded-action state remains later release-hardening work.
* Any future real executor for file, git, terminal, remote-access, or container actions requires a separate threat model, authorization checks, tests, and documentation before it can ship.

***


---

# 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/phase03-session04-guarded-local-action-runtime/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.
