# Agent Harness Memory: Six Designs and a Checklist File

Harness memory is whatever the harness writes down so the next session does not start blind. Anthropic's long-running harness used a feature file of over 200 items; six harnesses keep memory six ways. Docs read 19 Nov 2026. A CVE-2026-9198 checklist file shows which fields an agent may edit and what to retain.

## Why a harness needs memory at all

A model holds only its context window. Anthropic's long-running agent post describes the effect as "a software project staffed by engineers working in shifts, where each new engineer arrives with no memory of what happened on the previous shift" ([Effective harnesses for long-running agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents), 26 Nov 2025). Its fix was an initializer session that created an init.sh script, a claude-progress.txt log and a first git commit, then coding sessions that made one feature of progress and left a structured update.

The feature list is the detail worth copying. In the claude.ai clone example it ran to "over 200 features", all marked failing at first. Anthropic prompted agents "to edit this file only by changing the status of a passes field" and chose JSON because "the model is less likely to inappropriately change or overwrite JSON files compared to Markdown files". For an investigation agent the analogue is a checklist of required checks that the agent may tick but not rewrite. That protection rests on prompt wording and file format; a security harness can enforce it, as the worked example below does.

## Four techniques named in published posts

Each row is one vendor's description of its own design, read 19 Nov 2026.

| Technique | What the source says | Source |
|---|---|---|
| Compaction | "taking a conversation nearing the context window limit, summarizing its contents, and reinitiating a new context window with the summary" | [Anthropic, effective context engineering](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents) |
| Memory file | Harnesses support memory file standards like AGENTS.md, injected into context at agent start; as agents add and edit the file, the harness loads the update | [LangChain, Anatomy of an Agent Harness](https://blog.langchain.com/the-anatomy-of-an-agent-harness/) |
| Output offloading | Keeps the head and tail tokens of tool outputs above a threshold and offloads the full output to the filesystem | LangChain, same post |
| Session log outside the model | The session is "the append-only log of everything that happened"; a new harness resumes with wake(sessionId) | [Anthropic, Managed Agents](https://www.anthropic.com/engineering/managed-agents) |

Anthropic's multi-agent research post shows why saving matters: its lead agent saves its plan to memory because "if the context window exceeds 200,000 tokens it will be truncated" ([source](https://www.anthropic.com/engineering/multi-agent-research-system)). The Managed Agents post warns that compaction decisions are irreversible unless the removed messages are stored somewhere.

## How six harnesses implement memory

Alphabetical. Package versions from PyPI; mechanisms from each project's memory, session or persistence page, read 19 Nov 2026.

| Harness and version read | Short-term (one conversation) | Long-term (across conversations) | Where it lives and when it ends |
|---|---|---|---|
| Claude Agent SDK, Python 0.2.185 | Session transcripts as JSONL under ~/.claude/projects/<encoded-cwd>/; continue, resume or fork a session | CLAUDE.md, loaded when the project or user setting source is enabled (default query() options enable both) | Written to disk unless persistSession: false (TypeScript only); a SessionStore adapter mirrors transcripts to your backend. The docs add that passing results into a fresh session as application state is often safer than shipping transcript files between hosts |
| Deep Agents 0.7.40 | Conversation history and scratch files in agent state | Files passed to memory=, such as /memories/AGENTS.md; the agent edits them with edit_file, during the conversation by default or in background consolidation | Backend namespace decides scope: shared by all users (agent-scoped) or isolated per user. Developer-defined skills and organization policies are typically read-only |
| Google ADK 2.14.1 | Session (events) and state | MemoryService: InMemoryMemoryService, VertexAiMemoryBankService (extracts and consolidates memories with an LLM), VertexAiRagMemoryService | InMemoryMemoryService "data is lost on restart"; VertexAiMemoryBankService is managed by the Agent Platform and VertexAiRagMemoryService stores in Knowledge Engine |
| LangGraph 1.2.23 | Checkpointers keep thread state as checkpoints | Stores keep application-defined data across threads | InMemorySaver is lost on restart; checkpoints grow without bound, so the docs advise a retention job; keep PostgresSaver thread_id under 255 characters |
| Microsoft Agent Framework 1.26.0 | AgentSession and InMemoryHistoryProvider | FileMemoryProvider: the model decides what to store and recall through file_memory_* tools; on in the Harness Agent by default | Python derives the folder from the session ID, so sessions do not share files unless you pass a stable scope. Treat scope as an opaque namespace key and authorize externally supplied scopes. The older MemoryContextProvider APIs are deprecated for removal after 31 Dec 2026 |
| OpenAI Agents SDK 0.25.0 | Sessions on SQLite, Redis, SQLAlchemy, MongoDB, Dapr or OpenAI Conversations; SessionSettings(limit=N) keeps only the latest N items | None built in beyond sessions; OpenAIResponsesCompactionSession compacts long histories | EncryptedSession wraps another session with encryption and a ttl; the docs example sets ttl=600, ten minutes |

## Worked example: a checklist file for CVE-2026-9198

CVE-2026-9198 chains two Langflow flaws into unauthenticated remote code execution on default deployments of Langflow OSS 1.0.0 through 1.10.0 (CVSS 3.1 base score 9.8); 1.10.1 is the first fixed release. CISA added it to the Known Exploited Vulnerabilities catalog on 4 Aug 2026 with a due date of 7 Aug 2026, three days later, and marked forensic triage as required. The record lists four checks that together decide exposure: version, auto-login, network reach and an authenticating proxy. An investigation across several hosts spans more than one session, so the checks live in a file, not in the model's context.

The file below is created by a person or by a fixed script from the record, one per host, before the agent starts. It is a template; the host name is illustrative.

{
  "cve": "CVE-2026-9198",
  "host": "lf-prod-1",
  "created": "4 Aug 2026",
  "due": "7 Aug 2026",
  "checks": [
    {"id": "version", "condition": "Langflow OSS 1.0.0 through 1.10.0",
     "method": "pip show langflow", "status": "pending", "evidence": ""},
    {"id": "auto_login", "condition": "LANGFLOW_AUTO_LOGIN is true; unset on 1.10.0 or earlier counts as enabled",
     "method": "read the effective environment and the --env-file", "status": "pending", "evidence": ""},
    {"id": "reachable", "condition": "listening address reachable from an untrusted network",
     "method": "ss -ltnp, then firewall and security group rules", "status": "pending", "evidence": ""},
    {"id": "no_auth_proxy", "condition": "no authenticating reverse proxy in front",
     "method": "read the reverse proxy configuration", "status": "pending", "evidence": ""}
  ],
  "decision": {"outcome": "", "decided_by": "", "decided_at": ""}
}

Field rules for the checklist file. The enforcement idea is this site's design, not a vendor feature.

| Field | Who writes it | Rule |
|---|---|---|
| cve, host, created, due, condition, method | Person or script, at creation | Read-only to the agent. The conditions and methods come from the CVE record, not from the model |
| status | Agent | One of pending, met, not_met or unknown. met means the exposure condition on that row is true on this host; not_met means it is false. A check that cannot be run is unknown, never not_met |
| evidence | Agent | The command output or file excerpt that supports the status, with secrets removed |
| decision | Person | The agent may not write it. A host is exposed when all four checks are met; one not_met with evidence clears it; any unknown keeps it open. An exposed host needs a named approver before any change |

Enforce the table in the harness, not in the prompt. Give the agent one tool, record_check(host, id, status, evidence), that writes only status and evidence, and no general file-edit tool over the checklist path. A harness that lets the agent edit its own memory with a general edit tool, as Deep Agents does by default for memory files, would allow it to change a condition. The record also says not to call the auto_login route on a live system to test it: that route issues a superuser token on an affected version, so no tool for it should exist.

Session 1, 4 Aug 2026: the agent checks lf-prod-1 and records version met (1.9.2 is inside 1.0.0 through 1.10.0) and auto_login met (the value is true in the environment), then runs out of context before reaching the network checks. Session 2, 5 Aug 2026, starts with an empty context and reads the file: two checks done with evidence, two pending. It runs only the pending checks. Without the file, session 2 either repeats the first two or answers from the version alone, which the record says does not decide exposure. The values here are constructed; the checks and dates come from the record.

## What to keep, for whom, and for how long

Memory files and session logs persist whatever the agent saw. In this job that can include proxy logs with client addresses and, on an exposed Langflow host, a superuser token (the 1.10.1 release notes name a 365-day token). Retention is the team's decision; the table gives a starting rule for each store, to settle in the [evaluation checklist](/evaluation-checklist/evidence-and-audit-trail/).

Starting rules, not a standard. Time-to-live settings such as the ten-minute ttl in OpenAI's EncryptedSession example would delete a transcript long before triage ends.

| Store | Holds | Who may read | Keep until | Redaction |
|---|---|---|---|---|
| Checklist file | One host, one CVE: status and evidence per check | Security engineers and the approver | The ticket closes, then as long as your incident-record policy requires | Evidence holds command output with tokens and keys removed; write "token issued: yes", not the token |
| Session transcript or checkpoints | Everything the agent saw, including raw log lines | A named small group | For a host where all four checks are met, until forensic triage ends, because KEV requires it for this CVE; for a host with a not_met check, until the ticket closes | Cannot be redacted after the fact, so keep secrets out of tool output at the source |
| Long-term memory file | Standing facts such as which proxy fronts which service | The agent reads; people write | Reviewed at each model or prompt change | Agent writes disabled, or each write reviewed, so a wrong note cannot persist |
| Log excerpts | The matching lines behind an evidence entry | Security engineers | With the checklist file | Keep counts and the matching lines only |

## Context rot and long investigations

Anthropic defines context rot as: "as the number of tokens in the context window increases, the model’s ability to accurately recall information from that context decreases". Long alert investigations that pull many log queries into one context are exposed to it. Slack's investigation service avoids a single long context by passing only a condensed timeline of the most credible findings upward (Slack Engineering, December 1, 2025); [orchestration and subagents](/agent-harness/orchestration-and-subagents/) covers that design, and [logging and evidence](/agent-harness/logging-and-evidence/) covers the record side.

## Sources

- [Anthropic, Effective harnesses for long-running agents, 26 Nov 2025](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents), read 19 Nov 2026
- [Anthropic, Effective context engineering for AI agents](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents), read 19 Nov 2026
- [LangChain, The Anatomy of an Agent Harness, 10 Mar 2026](https://blog.langchain.com/the-anatomy-of-an-agent-harness/), read 19 Nov 2026
- [Anthropic, Scaling Managed Agents, 8 Apr 2026](https://www.anthropic.com/engineering/managed-agents), read 19 Nov 2026
- [Anthropic, How we built our multi-agent research system](https://www.anthropic.com/engineering/multi-agent-research-system), read 19 Nov 2026
- [Anthropic, Claude Agent SDK, Sessions](https://code.claude.com/docs/en/agent-sdk/sessions), read 19 Nov 2026
- [Anthropic, Claude Agent SDK, Modifying system prompts (CLAUDE.md loading)](https://code.claude.com/docs/en/agent-sdk/modifying-system-prompts), read 19 Nov 2026
- [PyPI, claude-agent-sdk 0.2.185](https://pypi.org/pypi/claude-agent-sdk/json), read 19 Nov 2026
- [LangChain, Deep Agents, Memory](https://docs.langchain.com/oss/python/deepagents/memory), read 19 Nov 2026
- [PyPI, deepagents 0.7.40](https://pypi.org/pypi/deepagents/json), read 19 Nov 2026
- [Google ADK, Memory](https://google.github.io/adk-docs/sessions/memory/), read 19 Nov 2026
- [PyPI, google-adk 2.14.1](https://pypi.org/pypi/google-adk/json), read 19 Nov 2026
- [LangChain, LangGraph, Persistence](https://docs.langchain.com/oss/python/langgraph/persistence), read 19 Nov 2026
- [PyPI, langgraph 1.2.23](https://pypi.org/pypi/langgraph/json), read 19 Nov 2026
- [Microsoft Learn, Agent Framework, Context providers](https://learn.microsoft.com/en-us/agent-framework/agents/conversations/context-providers), read 19 Nov 2026
- [Microsoft Learn, Agent Framework, Agent Harness](https://learn.microsoft.com/en-us/agent-framework/agents/harness), read 19 Nov 2026
- [PyPI, agent-framework 1.26.0](https://pypi.org/pypi/agent-framework/json), read 19 Nov 2026
- [OpenAI Agents SDK, Sessions](https://openai.github.io/openai-agents-python/sessions/), read 19 Nov 2026
- [PyPI, openai-agents 0.25.0](https://pypi.org/pypi/openai-agents/json), read 19 Nov 2026
- [Slack Engineering, security investigations with agents](https://slack.engineering/streamlining-security-investigations-with-agents/), read 19 Nov 2026
- [IBM security bulletin for CVE-2026-9198](https://www.ibm.com/support/pages/node/7278927), read 19 Nov 2026
- [Langflow 1.10.1 release notes](https://github.com/langflow-ai/langflow/releases/tag/v1.10.1), read 19 Nov 2026
- [CISA KEV entry for CVE-2026-9198](https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-9198), read 19 Nov 2026
- [NVD record for CVE-2026-9198](https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-9198), read 19 Nov 2026

Last reviewed 19 Nov 2026

Canonical: https://agenticaiincybersecurity.com/agent-harness/context-and-memory/
