aws-durable-execution-sdk-python
AGENTS.md56 starsChanged 6 months agoApache-2.0View on GitHub
This repository contains the AWS Durable Execution SDK for Python and its companion packages, used to author AWS Lambda durable functions. Do not rely on this file for method signatures, configuration objects, or code examples. The canonical reference is the AWS Durable Execution SDK Developer Guide, which is maintained alongside SDK releases and covers TypeScript, Python, and Java. Key sections: For Lambda service topics such as deployment, infrastructure as code, invocation, IAM permissions, and quotas, see the Lambda durable functions…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Do not rely on this file for method signatures, configuration objects, or code examples.
- Distinctive: line 46
Never call durable operations inside a step: Use a child context to group operations.
- Very specific: line 50
Side effects outside steps repeat on every replay: Put side effects in steps.
- Very specific: line 59
Do not use yaml.load() or yaml.load_all(), including with Loader= arguments or suppression comments.
- Very specific: line 62
Use yaml.safe_load() or yaml.safe_load_all() for plain YAML.
- Very specific: line 70
Before finishing YAML-related changes, check Python code for unsafe call forms: rg -n --glob '*.py' "yaml\\.load\\b|yaml\\.load_all\\b|from …
- Distinctive: line 78
Do NOT add or modify conformance tests without coordinating with the team.
- Very specific: line 87
Read CONTRIBUTING.md before making changes.
- Distinctive: line 91
When the developer guide and the installed SDK source disagree, trust the source in this repository and report the discrepancy.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AWS Durable Execution SDK for Python - Agent Guide
This repository contains the AWS Durable Execution SDK for Python and its companion packages, used to author AWS Lambda durable functions.
Use the developer guide, not this file, for APIs
Do not rely on this file for method signatures, configuration objects, or code examples. The canonical reference is the AWS Durable Execution SDK Developer Guide, which is maintained alongside SDK releases and covers TypeScript, Python, and Java. Key sections:
For Lambda service topics such as deployment, infrastructure as code, invocation, IAM permissions, and quotas, see the Lambda durable functions guide.
Critical rules: the replay model
Durable functions use checkpoint and replay. After a wait, failure, or resume, code re-runs from the beginning. Completed steps return their checkpointed results without re-executing, and code outside steps runs again on every replay. This implies four rules:
- Code outside steps must be deterministic. Wrap timestamps, random values, UUID generation, API calls, and any other non-deterministic work in a step.
- Never call durable operations inside a step. Use a child context to group operations.
- Closure mutations inside steps are lost on replay. Return values from steps instead of mutating enclosing scope.
- Side effects outside steps repeat on every replay. Put side effects
in steps.
context.loggeris the exception: it is replay-aware and safe anywhere.
See Determinism and Replay for worked examples.
Security-sensitive parsing
- Do not use
yaml.load()oryaml.load_all(), including withLoader=arguments or suppression comments. CodeQL and security scanners flag the unsafe call form even when the loader subclassesyaml.SafeLoader. - Use
yaml.safe_load()oryaml.safe_load_all()for plain YAML. - For CloudFormation or SAM templates with short-form tags such as
!Ref,!Sub,!GetAtt, or!If, use ayaml.SafeLoadersubclass with explicit tag constructors so the tags are preserved. - For custom safe loaders, instantiate the loader directly, call
get_single_data()or the equivalent multi-document API, and calldispose()in afinallyblock. This matches whatyaml.safe_load()does internally while preserving custom tag support. - Before finishing YAML-related changes, check Python code for unsafe call
forms:
rg -n --glob '*.py' "yaml\\.load\\b|yaml\\.load_all\\b|from yaml import load\\b|from yaml import load_all\\b" .
Testing Requirements
All changes MUST include related tests. At minimum, include unit tests. Include e2e integration tests (in the tests/e2e/ directory) when the change affects cross-component behavior, public API surfaces, or end-to-end workflows. For isolated bug fixes where a unit test alone sufficiently covers the fix, integration tests are not required.
Do NOT add or modify conformance tests without coordinating with the team. Conformance test requirements and the runner live in a separate repository (aws-durable-execution-conformance-tests). If a change warrants a new conformance test, note it in the PR description or open an issue in that repository.
Working in this repository
- Packages live under
packages/: the core SDK (aws-durable-execution-sdk-python), the testing library (aws-durable-execution-sdk-python-testing), the OpenTelemetry plugin (aws-durable-execution-sdk-python-otel), and examples (aws-durable-execution-sdk-python-examples). - Read CONTRIBUTING.md before making changes. Use
hatchfor all tests, type checks, and formatting (for examplehatch run dev-core:test,hatch run dev-core:typecheck, andhatch fmt --checkfrom a package directory). - When the developer guide and the installed SDK source disagree, trust the source in this repository and report the discrepancy.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

