A long-running agent is a workflow that can sleep.
Between two wake-ups, the worker process, the server, and the model's context window may all vanish. What survives is a set of stored records, and the agent's real skill is not remembering; it is being rebuilt correctly and safely from those records every single time it wakes. 🧭
This matters because real business work is mostly waiting: a signature, a supplier reply, a manager's approval, a shift handover. While the work waits, permissions can be revoked, policies can change, documents can be swapped, and a retried message can fire twice. A long-running design has two jobs at once: keep the progress, and keep the consequences of that progress under control. 🛡️
- 1. The model: four stores, one disposable window
- 2. The resume protocol: seven gates and context assembly
- 3. Progress: checkpoints and state design
- 4. Identity, sessions, and authority across time
- 5. Memory: write paths, read paths, poisoning
- 6. Waiting, events, approvals, and deadlines
- 7. Failure: crashes, retries, concurrency, compensation
- 8. Securing persistent context (threats to controls)
- 9. Hands-on lab: crash a durable agent on purpose
- 10. Enterprise rollout
- 11. Common mistakes
- 12. FAQ
- 13. References
- 14. Summary
- Appendix: fact-check log and known limits
1. The model: four stores, one disposable window
Most long-running failures come from storing these four things in one bucket (usually a chat transcript). Keep them apart, because they differ in who may write them, how far they are trusted, and when they should expire:
| Store | Answers | Who may write it | Trust | Lifetime |
|---|---|---|---|---|
| Progress | Where are we? What is done, pending, owed? | Deterministic code only, never raw model text | High, integrity-protected | Task life plus audit retention |
| Authority | Who may do what, under which rules and versions? | Identity provider, policy owners | Highest, and read live, not copied | Not stored; re-read at each wake-up |
| Memory | What do we durably believe about this user or domain? | A validated write path with provenance | Medium: scoped, expiring, re-verifiable | Explicit expiry per record |
| Evidence | What did outside sources say? | Anyone, therefore untrusted | None as instruction | Short; keep references, not copies |
A fifth category hides inside most systems: model-generated residue such as summaries, plans, and earlier replies. It is derived from whatever the model read, including untrusted text, so it inherits that text's risk. It belongs in the audit log, and it must never be promoted to Progress, Authority, or Memory without a validation step. (analysis)
🎯 Use this when... a task can outlive a request, a worker, a day, or a human reply.
2. The resume protocol: seven gates and context assembly
“Resume” is not “load the checkpoint and continue”. It is a short, fixed sequence in which every step can say no:
- Authenticate the caller, or verify the signature on the incoming event (section 7).
- Authorize that principal for this task. Knowing the task ID is not permission (section 5).
- Load and verify the stored state: integrity check, expected version number, and a schema you still understand.
- Check compatibility of the policy, tool catalog, and schema versions the task started with against what is deployed now (section 11).
- Re-validate anything time-sensitive against the system of record: is the approval still valid, is the approver still allowed, did the underlying object change, has the deadline passed?
- Assemble a small, labelled context window (below).
- Propose, validate, execute once. The model suggests; code checks the suggestion against Progress and Authority; the side effect runs under an idempotency key (section 8).
Context assembly: what goes into the window on wake-up
The window is built fresh and thrown away. A good build, in this order:
| Layer | Comes from | How it is rendered |
|---|---|---|
| 1. Standing instructions | Authority (versioned) | Fixed text, pinned to the task's policy version |
| 2. Task card | Progress | Generated by code from fields (stage, pending items, deadlines, IDs), never from free text the model wrote earlier |
| 3. Recent events | Progress log | The last few decisions and observations since the previous checkpoint |
| 4. Relevant memory | Memory | Only scoped, unexpired, active records, each shown with its provenance |
| 5. Evidence needed now | Evidence | Short excerpts inside clear delimiters and a label such as “untrusted source: supplier email”; fetched again if stale |
| 6. Tool definitions | Authority | Only the tools permitted at the current stage, not the whole catalog |
Left out on purpose: the full transcript, old bulky tool outputs, credentials, and anything the current stage does not need. Each extra item is another place for a contradiction, a stale fact, or a planted instruction to hide. (analysis)
🎯 Use this when... an agent restarts, scales out to a new worker, or wakes from an event after hours or days.
3. Progress: checkpoints and state design
Two kinds of checkpoint exist, and they are not the same. Frameworks save engine state at their own boundaries: LangGraph at super-step boundaries, Microsoft Agent Framework whenever a superstep finishes. Your business milestones (request accepted, approval recorded, notice sent) only line up with those boundaries if you design them to. The practical rule is to put each external side effect in its own step, so it gets its own boundary, and to assume that work inside an unfinished step may run again.
A useful checkpoint record has five layers:
- Business state: stage, status, deadlines, owner.
- Execution state: pending work, cursors, child-task references.
- External references: IDs for files, tickets, jobs, approvals (never the bulky content itself).
- Security scope: tenant, principal reference, approval status. Store a reference to who acted, not their credentials.
- Version stamps: schema version, policy version, tool-catalog version, stable agent IDs, and a state version counter for concurrency.
checkpoint = {
"task_id": "TASK-8841",
"state_version": 7, # bumped on every transition (compare-and-swap)
"stage": "awaiting_vendor_reply",
"completed": ["request_created", "notice_sent"],
"pending": [{"wait_for": "vendor_reply", "correlation_id": "corr-31", "deadline": "2026-10-09T09:00Z"}],
"artifact_refs": ["object://finance/invoice-8841.json"], # references, not copies
"scope": {"tenant": "india-finance", "principal_ref": "user:buyer_17"},
"approval": {"status": "not_required"},
"versions": {"schema": 3, "policy": "refund-policy-v1", "tools": "catalog-2026-09-14", "agent_id": "po-agent"},
"updated_at": "2026-10-02T10:15:00Z",
}Let code enforce the state machine. A transition table that rejects illegal moves is a few lines, and it is the difference between “the prompt asks the model not to skip steps” and “skipping is impossible”:
ALLOWED = {
"received": {"awaiting_approval", "ready"},
"awaiting_approval": {"ready", "needs_review"},
"ready": {"closed", "needs_review"},
}
def transition(task, new_stage):
if new_stage not in ALLOWED.get(task.stage, set()):
raise ValueError(f"illegal transition {task.stage} -> {new_stage}")
Integrity is not the same as secrecy. Encrypting stored state hides it from readers; it does not stop someone from editing, deleting, or replaying it. A keyed MAC over the state, checked at gate 3, detects edits:
import hmac, hashlib, json
def seal(state: dict, key: bytes) -> dict:
blob = json.dumps(state, sort_keys=True).encode()
return {"state": state, "mac": hmac.new(key, blob, hashlib.sha256).hexdigest()}
def open_sealed(sealed: dict, key: bytes) -> dict:
blob = json.dumps(sealed["state"], sort_keys=True).encode()
good = hmac.compare_digest(hmac.new(key, blob, hashlib.sha256).hexdigest(), sealed["mac"])
if not good:
raise ValueError("checkpoint failed integrity check: quarantine, do not resume")
return sealed["state"]state_version against a counter kept in a separate trusted place.🎯 Use this when... you need a precise, auditable point from which work can continue without guessing what already happened.
4. Identity, sessions, and authority across time
A session or thread ID answers “which continuing interaction?”. A task ID answers “which piece of business?”. Neither answers “who is asking, and are they allowed?”. Keep five identifiers distinct:
| Identifier | Answers | Never use it for |
|---|---|---|
| Principal | Who is acting, as established by your identity provider | Anything a caller can simply claim in a request body |
| Tenant | Which security domain owns the data | Building store names or file paths from user input |
| Thread / session | Which conversation to continue | Authorization |
| Task / workflow | Which business process is in motion | Authorization |
| Run / attempt | Which execution produced this action | Deduplicating side effects (use an operation key) |
Authority is carried across time, so give it a lifetime
When work resumes in a different process days later, the original request's identity is gone. Platforms solve this by letting you carry a caller reference into deferred work: Foundry, for example, lets item operations take an explicit call ID for work that outlives the request. That is convenient and also dangerous, because you are now carrying delegated authority forward. Safe patterns:
- Store a reference to the principal, never a reusable credential, in checkpoints, memory, and traces.
- Obtain a fresh, short-lived credential at resume for exactly the tools the current stage needs.
- Put an expiry on carried authority and on approvals; when it lapses, the task parks and asks again.
- Step up for high-impact actions: recent re-authentication or a second person, not just “the task was approved last week”.
🎯 Use this when... the same business process may reconnect from another device, worker, or day.
5. Memory: write paths, read paths, poisoning
Memory is the store people trust most and check least. Treat it like a database with two doors, a write door and a read door, and put controls on both.
The write door
- Who writes? A named component with a purpose, not “whatever the model felt like saving”. Record the writer.
- What triggers it? Many managed memory systems extract records with a model, so the text being read can steer what gets stored. AgentCore's own docs describe asynchronous, model-driven extraction and consolidation. When your application already knows a scope field such as tenant or department, supply it directly (AgentCore's strictly consistent metadata exists for this) rather than letting a model infer it.
- Every new ingestion path is a new attack path. A direct-ingest API like AgentCore's IngestData is useful, and it also means content can reach long-term memory without ever passing through the conversation. Protect it like any privileged endpoint.
- High-impact facts are never remembered on say-so. “Our bank details changed” is exactly what an attacker plants. Require out-of-band verification before such a record can become active.
The read door
memory_record = {
"value": "prefers invoices at finance@example.com",
"scope": {"tenant": "india-finance", "subject": "vendor:V-204"},
"written_by": "preference-extractor@v4", # which component wrote it
"provenance_ref": "event:evt-5521", # which source event it came from
"source_kind": "vendor_email", # where the words originally came from
"status": "quarantined", # quarantined | active | revoked
"verified_by": None, # set when a human or system of record confirms
"created_at": "2026-10-02T10:20:00Z",
"expires_at": "2027-01-02T00:00:00Z",
}- Retrieve only active, unexpired, in-scope records, and show their provenance in the window.
- Re-verify before acting when a remembered fact drives money, access, or a customer notice.
- Plan deletion up front. Consolidation can merge several sources into one record, so removing a source does not automatically remove what was derived from it. Keep lineage so a deletion request can find every derived copy: summaries, embeddings, consolidated records.
can_influence_policy: false protects nothing if the code that builds decisions never checks it, and it can be forged by whoever writes the record. Authority comes from where code reads from: the policy engine reads rules only from the policy store, so no memory record can ever reach it. (analysis)🎯 Use this when... an agent must remember something beyond the current interaction without turning every past sentence into permanent authority.
6. Waiting, events, approvals, and deadlines
Waiting is a first-class state with its own record. Write down what you wait for, how to recognize it, how long to wait, and what to do if it never comes:
"pending": [{
"wait_for": "manager_approval",
"correlation_id": "corr-31", # how the incoming event finds this task
"bound_to_version": 7, # the exact task version being approved
"allowed_signers": ["approvals-service"],
"deadline": "2026-10-09T09:00Z",
"on_deadline": "escalate_to:finance-lead"
}]
An incoming event is untrusted input until proven otherwise. Process it in this order: verify authenticity, drop duplicates, match it to a task and version, check the state machine allows it now, and only then move the task forward with a compare-and-swap.
import hmac, hashlib, time
def verify_event(secret: bytes, body: bytes, sig_hex: str, timestamp: int, max_age_s: int = 300) -> bool:
if abs(time.time() - timestamp) > max_age_s: # reject replays of old, validly signed messages
return False
expected = hmac.new(secret, f"{timestamp}.".encode() + body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, sig_hex) # constant-time comparisonevent_id in an inbox table with a unique constraint so a redelivered event is recognized and ignored.UPDATE tasks SET stage = :new_stage, state_version = state_version + 1 WHERE id = :task_id AND state_version = :expected_version; -- 0 rows updated means someone else moved first: re-read, re-validate, do not blindly retry.
Approvals are objects, not booleans. “An approval exists” is the wrong question. Record what exactly was approved (the object and its version or hash), by whom, for what scope, until when, and whether it is single-use. On resume, check that each of those still holds. If the request changed after the click, the approval is void and a new one is needed. The lab in section 10 lets you watch this happen.
Every wait needs a deadline and an owner for the deadline. Microsoft's durable-orchestration example races the approval event against a 24-hour timer and escalates when the timer wins. Without that, tasks do not fail; they just sit forever, which is worse.
working, input_required, completed, failed, cancelled), a TTL, and a suggested poll interval. The server may delete a task after its TTL, so “task not found” must be a handled outcome. Clients are told to persist task IDs so polling survives a restart. Cancellation is cooperative: the server acknowledges the request, and the task may still finish. Treat cancel as a request, never a guarantee. Note too that Tasks cover tools/call only; they are a handle for one slow tool, not a replacement for your own workflow state.🎯 Use this when... people, systems, timers, or queues may take minutes, hours, or days to produce the next event.
7. Failure: crashes, retries, concurrency, compensation
Assume at-least-once: steps, events, and retries can all happen twice. The only dangerous thing is an external side effect, and the dangerous moment is the gap between “request sent” and “outcome recorded”. Walk through every place a crash can land:
| Crash lands… | What the stores say | Safe response |
|---|---|---|
| A. before the intent is recorded | Nothing happened | Just retry |
| B. after intent, before the downstream call | Intent says in-flight; downstream has nothing | Retry the call with the same key |
| C. after the downstream call, before the outcome is saved | Intent says in-flight; downstream did act | Ambiguous. Retry with the same key so the downstream returns the existing result, or look it up by key |
| D. after the outcome is saved, before the stage advances | Intent says done | Skip the call, advance the stage |
Case C is the one that hurts, and it is what a naive “look it up, then do it, then save it” check misses: two workers can both see “not done”, and a crash after the action loses the record entirely. The fix is to record the intent first using a unique key, and to pass that same key to the downstream system:
def execute_once(db, op_key, call_downstream):
# 1) record intent; the PRIMARY KEY makes this atomic across workers
db.execute("INSERT OR IGNORE INTO actions(op_key, status) VALUES (?, 'in_flight')", (op_key,))
status, result = db.execute("SELECT status, result FROM actions WHERE op_key=?", (op_key,)).fetchone()
if status == "done":
return result # replay-safe
# 2) call downstream WITH the key so it can recognise a retry
result = call_downstream(idempotency_key=op_key)
# 3) record the outcome
db.execute("UPDATE actions SET status='done', result=? WHERE op_key=?", (result, op_key))
return resultBuild the key from the business operation, such as REFUND:{task_id}:v{version}, never from a random value generated per attempt. Including the version means an amended task is a different operation and needs its own approval.
When the downstream cannot take an idempotency key, you have four honest options: look up by a natural key before writing; run a reconciliation job that compares your records with theirs; put a human in front of the action; or accept a compensating action (below).
| Operation type | Retry policy |
|---|---|
| Read-only | Retry freely with backoff |
| Write with an idempotency key | Retry with the same key |
| Reversible write, no key | Reconcile first, then retry or compensate |
| Irreversible (money out, deletion, external notice) | Never auto-retry an ambiguous outcome; reconcile or escalate to a person |
Concurrency, compensation, and giving up gracefully
- One writer per task. Use the compare-and-swap above (Foundry's ETag with
If-Matchis the same idea) or a lease with an expiry. Two wake-ups on one task is normal, not exceptional. - Compensation. If step 4 of 6 fails permanently, steps 1–3 may need undoing (cancel the hold, void the notice). Write the compensating action for each step that has a side effect, and run it deliberately, not by hoping the retry works. This is the saga pattern.
- Poison tasks. After N failed attempts, stop retrying: move the task to a
needs_reviewstage with the evidence attached and alert a human. Infinite retry is a cost incident waiting to happen. - Deterministic replay. Microsoft's durable orchestrations rebuild their position by replaying code, so orchestration code must be deterministic. Put randomness, the clock, and network calls inside activities, not in the orchestrator body.
🎯 Use this when... an agent can retry, resume, scale out, process duplicate events, or call tools whose effects cannot be undone.
8. Securing persistent context (threats to controls)
Persistence changes the security model: yesterday's content can become tomorrow's instruction. Start by classifying what can enter the window, then decide what each class may do:
| Class | Examples | May it instruct the agent? | May it be written to memory? |
|---|---|---|---|
| Control data | Approved policy, authenticated identity, current permissions, workflow state | Yes, because code supplies it | Not applicable |
| Evidence | Emails, documents, web pages, customer files, tool-returned text | No. Information only | Only as a quarantined, proposed record |
| Derived memory | Extracted facts and preferences | Only as information, with provenance shown | Yes, through the controlled write path |
| Model residue | Summaries, plans, earlier replies | No. It may carry planted text | No, unless validated like evidence |
| Tool and server metadata | Tool names, descriptions, schemas, server-supplied prompts | Descriptions steer the model, so treat them as code you must vet | No |
The controls that actually bound damage live outside the model. This table maps each threat to where it enters and what limits it:
| Threat | Enters through | Primary controls | Residual risk |
|---|---|---|---|
| Instruction injection | Evidence, tool output, web pages | Code-side validation of every proposed action; stage-scoped tools; approvals for high-impact steps; egress allow-lists | A persuaded model can still request something allowed but unwise |
| Memory poisoning (OWASP ASI06) | Extraction pipelines, direct-ingest APIs, shared stores | Quarantine by default; writer and provenance on records; scope and expiry; re-verify high-impact facts | Slow drift from many small, plausible records |
| Tool-description change | A server or tool catalog that alters its own text between runs | Pin the tool catalog version a task started with; hash and review descriptions; MCP list responses now carry cache hints, so decide deliberately when to refresh | A reviewed description can still be misleading |
| Stale authority | Old approvals, carried call identities | Expiry; version-bound approvals; fresh short-lived credentials at resume | Revocation lag inside the credential lifetime |
| State tampering | Writable checkpoint store, unsafe deserialization | Restricted write access; MAC plus version counter; never load state from untrusted sources; safe serializers | A compromised key or insider with write access |
| Cross-tenant leakage | Shared indexes, shared memory, confused identifiers | Tenant scope enforced by the platform or database, not by a prefix in a key; test isolation on the deployed system | Misconfiguration |
| Exfiltration | Model-built URLs or messages carrying data out | Egress allow-lists; outbound content checks; no credentials in the window | Data hidden in permitted channels |
| Cross-agent spread | Hand-offs and shared memory | Minimal hand-off packets; re-authorization by the receiver; no wholesale memory sharing | Trust between cooperating agents |
Hand-offs between agents
A hand-off is a trust boundary, not a copy-paste. Pass a packet with: task ID and version, purpose, the exact actions the receiver may take, an expiry, and evidence by reference with its trust label. Do not forward the whole transcript or the sender's memory: that exports the sender's mistakes and any planted text along with the context. The receiver should re-authorize itself rather than inherit the sender's authority.
🎯 Use this when... the agent remembers across sessions, or acts on behalf of a user or process.
09. Enterprise rollout
Treat the context pipeline as a governed product: instructions, tool definitions, memory rules, schemas, and retention settings all change what the agent can do, even when application code does not.
Ownership and release gate
Name an owner for the agent, the tool catalog, the memory policy, each data domain, and incident response. A change to any context source passes a gate: what changes; which running tasks are affected; security review of trust boundaries, scopes, secrets, and egress; proof that in-flight tasks can resume, roll back, or be quarantined; confirmation that traces still show who did what under which version; sign-off by a business owner and a technical or security owner; then a bounded rollout with a rollback path.
What happens to tasks already in flight when you ship a change?
| Strategy | Choose it when | Watch out for |
|---|---|---|
| Pin: tasks finish on the versions they started with | The change is not security-critical and the old version is safe to run | Old versions must stay deployable; pinned tasks can linger for weeks |
| Migrate: convert state and continue on the new version | A compatibility test passes for every stage a task can be in | Silent semantic changes; renamed agents or executors can break resume (the Microsoft docs call this out) |
| Quarantine and restart from the last safe milestone | A security fix or incompatible schema forces it | Re-asking people for approvals; duplicate side effects if milestones were chosen badly |
Secrets, cost, observability, alerts
- Secrets: references only in state, memory, traces, and tool output; short-lived credentials issued at resume; each tool gets the narrowest scope that serves one purpose.
- Data classification and retention: every item allowed into durable context has an owner, class, purpose, scope, retention rule, and deletion path, including derived copies.
- Cost: track spend by task, tenant, workflow type, and tool; set budgets and stop conditions so a retry loop becomes an alert rather than an invoice.
- Observability: one trace connecting task, run, transition, tool call, external event, and outcome, stamped with policy and tool-catalog versions. Dashboards for active, waiting, stuck, and quarantined tasks, retry counts, approval latency, state-store errors, and memory growth.
- Alerts: unexpected tool use, version mismatches on resume, repeated authorization failures, integrity-check failures, unusual egress, tasks past their deadline, resume attempts from the wrong tenant or principal.
Incident response: have a kill path
Be able to freeze new runs, disable tools, revoke credentials, quarantine memory records by writer or time window, stop queued work, preserve evidence, and resume only after authority is restored. Practise it before you need it. Note how a memory record carries written_by: that field is what lets you quarantine one faulty extractor's output instead of deleting everything.
Test the resume path, not just the happy path
- Kill the worker between each pair of steps and confirm no duplicate side effect.
- Deliver the same event twice, and deliver events out of order.
- Approve, change the request, then try to use the approval.
- Revoke the approver's rights while the task waits.
- Change a tool description or policy version mid-flight.
- Edit a stored checkpoint by hand and confirm it is quarantined.
- Let a TTL expire during a wait and confirm the failure is loud and recoverable.
- Wake the same task from two workers at once.
Google's sample uses golden evaluation cases to check that an agent refuses to skip a pause gate. That is the right instinct; extend it to the failure cases above.
Frameworks to anchor reviews: the OWASP Top 10 for Agentic Applications (2026) and the OWASP LLM Top 10 2026 edition for threats (item numbers may differ from the 2025 list, so re-check any reference you copied); the NIST AI Risk Management Framework and its Generative AI Profile for governance. Adapt them to your own threat model; they are not a checklist substitute.
🎯 Use this when... an agent moves from a team experiment to a business-critical workflow with real permissions and real data.
10. Common mistakes
- Prompt-only state machines. A prompt that says “do not skip steps” is a request. Enforce transitions in code.
- Treating labels as walls. A tag on untrusted text helps your code and logs; it does not stop the model from following it. Bound the damage outside the model.
- Memory without a write policy. Anything the extractor can store becomes tomorrow's fact. Use a controlled write path, quarantine, provenance, scope, and expiry.
- Encrypting state and calling it safe. Encryption hides; it does not detect edits or rollback. Add a MAC and a version counter.
- Session ID as a credential. It is a locator. Authenticate and authorize independently.
- Unauthenticated wake-up webhooks. A resume endpoint is a login. Sign, time-bound, deduplicate, and bind events to a task version.
- Look-up-then-act idempotency. It races and loses the record on a crash. Record intent first and pass the key downstream.
- Assuming cancel stops work. In MCP Tasks, cancellation is cooperative. Reconcile instead of assuming.
- Surprise expiry. Default TTLs can end a long task silently. Set them deliberately and alert before they fire.
- Stuffing the window. Replaying everything invites stale facts and planted text. Assemble a small, labelled window each time.
- Approval fatigue. Asking about every step trains people to click through. Tier by impact and show real evidence where judgement matters.
- No kill path. Without one switch to freeze runs, revoke credentials, and quarantine state, a bad day becomes a bad week.
11. FAQ
12. References
- LangGraph: Persistence (checkpoints, threads, pending writes)
- Microsoft Agent Framework: Checkpoints (incl. Security Considerations)
- Microsoft Agent Framework: Durable Extension
- Microsoft Foundry: Durable state store for hosted agents (preview)
- Microsoft Foundry: Standard agent setup (customer-managed state)
- OpenAI Agents SDK: Sessions (incl. SQLite storage trust boundary)
- AWS: AgentCore Memory types
- AWS What's New: strictly consistent metadata for long-term memory (15 Jun 2026)
- AWS What's New: direct ingestion to long-term memory (8 Sep 2026)
- AWS What's New: AgentCore memory, policy, and harness in GovCloud (7 Aug 2026)
- Model Context Protocol: 2026-07-28 specification release
- Model Context Protocol: Tasks extension (2026-07-28)
- OWASP: Top 10 for Agentic Applications for 2026
- OWASP: GenAI LLM Top 10 2026
- NIST: AI Risk Management Framework
- NIST: AI RMF Generative AI Profile
13. Summary
- A long-running agent is a workflow that can sleep; the context window is a view rebuilt from stores on every wake-up.
- Keep progress, authority, memory, and evidence apart; treat model-written residue as untrusted.
- Resume through seven gates; the model proposes, deterministic code disposes.
- Checkpoints follow engine boundaries, so give every side effect its own step; protect state with integrity checks, not just encryption.
- Session and task IDs are locators; authority is verified live and carried with an expiry.
- Memory needs a controlled write door and a labelled read door; flags are not controls.
- Events are untrusted until verified; approvals are version-bound objects; every wait has a deadline.
- Assume at-least-once: record intent first, pass keys downstream, compare-and-swap, compensate, quarantine.
- Version, pin, and test the resume path; watch TTLs; keep a kill switch.
Build it so a restart is ordinary, a duplicate event is survivable, a stale approval is refused, and a compromised context reaches only a small part of the system. That is what turns an agent that works in a demo into one an enterprise can run.
Comments
Post a Comment