self-managed-context
Pass
Audited by Gen Agent Trust Hub on Oct 3, 2026
Risk Level: SAFEINDIRECT_PROMPT_INJECTIONCOMMAND_EXECUTIONEXTERNAL_DOWNLOADSDYNAMIC_EXECUTION
Full Analysis
- [INDIRECT_PROMPT_INJECTION]: The skill implements a self-managed context protocol where the agent has write access to a mirror of its own conversation history in a local file. This mechanism creates a surface for instructions to be persisted and potentially followed by the model in subsequent turns.
- Ingestion points: The mirror file, located at
/tmp/.live_ctx/LIVE_CTX_MAIN.txt, is read and parsed back into the message list during the execution step described inSKILL.mdandreferences/harness-protocol.md. - Boundary markers: The implementation uses structured turn headers (
[[CTX_TURN n role=...]]) and a "pinned prefix" system to ensure that core system instructions and the initial task are never exposed to the editable file or overwritten. - Capability inventory: The agent utilizes shell commands (
run_shell) and file system operations to read, write, and manipulate the context mirror. - Sanitization: The
parse_backlogic includes "role folding," which automatically maps any model-written roles (including 'system' or 'tool') back to the 'user' role, preventing the agent from programmatically assuming higher authority. - [COMMAND_EXECUTION]: The skill provides functional examples where the agent uses shell commands to interact with its environment to perform context housekeeping.
- Evidence: The
step()function inSKILL.mdexecutes commands provided by the model, and Example 2 demonstrates the use of shell-based text processing (viare.sub) to update the context file. - [EXTERNAL_DOWNLOADS]: The documentation references external research and code repositories from well-known and reputable organizations.
- Evidence: Links and references to
github.com/facebookresearch/context-language-models,arxiv.org, and safety reports fromalignment.openai.comare used for technical validation. - [DYNAMIC_EXECUTION]: The reference implementation involves generating and running short scripts to perform surgical edits on the context mirror.
- Evidence: Example 2 in
SKILL.mdshows a pattern where a Python script is generated as a heredoc within a Bash command to modify the mirror file at runtime.
Audit Metadata