control-arena
AGENTS.md262 starsChanged 12 months agoMITView on GitHub
This repository contains code for control-arena, an open source library for AI Control experiments built on top of Inspect AI. It is built by the UK AI Security Institute. Code can be found in control_arena/. Docs can be found in docs/. Also see README.md and CONTRIBUTING.md for more information.
We split this AGENTS.md into the rules it gives an agent
13 rules. About 0 are common, 4 are distinctive, and 9 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.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Run python code: uv run path/to/script.py
- Very specific: line 16
Run all tests: uv run pytest or uv run pytest -m "not skip_ci and no long_running"
- Very specific: line 17
Run a single test: uv run pytest tests/path/to/test_file.py::test_function_name -v
- Very specific: line 24
Formatting: Follow Google style convention.
- Distinctive: line 25
Imports: Use isort order (enforced by ruff).
- Distinctive: line 27
Naming: Use snake_case for variables, functions, methods.
- Distinctive: line 31
Error Handling: Use appropriate exception types.
- Distinctive: line 33
String Formatting: Don't wrap lines manually unless they should explicitly be separated by a line break.
- Very specific: line 35
Use anyio.sleep() instead of asyncio.sleep()
- Very specific: line 36
Use from control_arena._async_utils import gather instead of asyncio.gather() / asyncio.create_task()
- Very specific: line 39
Use from control_arena._async_utils import run_sync instead of asyncio.run() for sync-to-async entry points
- Very specific: line 40
Use anyio.open_process() instead of asyncio.create_subprocess_exec() (and catch anyio.EndOfStream when reading from process streams)
- Very specific: line 49
Commit messages: Use Conventional Commits -- <type>: <description>.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 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
AGENTS.md
This file provides guidance to AI coding assistants when working with code in this repository.
Repository Overview
This repository contains code for control-arena, an open source library for AI Control experiments built on top of Inspect AI. It is built by the UK AI Security Institute.
Code can be found in control_arena/.
Docs can be found in docs/.
Also see README.md and CONTRIBUTING.md for more information.
Build/Lint/Test Commands
- Run python code:
uv run path/to/script.py - Run all tests:
uv run pytestoruv run pytest -m "not skip_ci and no long_running" - Run a single test:
uv run pytest tests/path/to/test_file.py::test_function_name -v - Format code:
uv run ruff format - Lint code:
uv run ruff check --fix - Type check:
uv run pyright
Code Style Guidelines
- Formatting: Follow Google style convention. Use ruff for formatting. Try to follow ruff styles directly when writing code. You can see what rules we have enabled in
pyproject.toml. - Imports: Use isort order (enforced by ruff). Imports must be at the top of the file, unless there is a very good reason otherwise.
- Types: Strict typing is required. All functions must have type annotations
- Naming: Use snake_case for variables, functions, methods; PascalCase for classes
- Docstrings: Google-style docstrings required for public APIs. These will be used for automatic documentation generation and so should be clear, easy to understand and complete.
- Documentation: This project uses Quarto for documentation. See
docs/for examples. When adding new public APIs we may need to update the docs, including the automated API reference section indocs/reference/. Lists within .qmd files must be separated by a blank line from anything above, otherwise they will not render properly. - Spelling: This project is built by the UK AI Security Institute, so use UK English spelling where relevant.
- Error Handling: Use appropriate exception types; include context in error messages. Use if / raise rather than assert for runtime checks.
- Testing: Write tests with pytest; maintain high coverage. No need to mark async tests with
pytest.mark.asyncioas this is configured automatically. Usepytest.mark.skip_cifor tests that should not run in CI (e.g. because they call LLMs), andpytest.mark.long_runningfor tests that take a long time to run. - String Formatting: Don't wrap lines manually unless they should explicitly be separated by a line break. Instead, put strings (e.g. docstrings) on one line so that they can be wrapped automatically by whatever editor is being used.
- Async Code: This project supports both asyncio and trio backends via anyio (configured by the
INSPECT_ASYNC_BACKENDenvironment variable). Do not useasyncioprimitives directly. Instead:- Use
anyio.sleep()instead ofasyncio.sleep() - Use
from control_arena._async_utils import gatherinstead ofasyncio.gather()/asyncio.create_task() - Use
from control_arena._async_utils import gather_with_exceptionsinstead ofasyncio.gather(*coros, return_exceptions=True) - Use
from control_arena._async_utils import as_completed_with_exceptionsinstead ofasyncio.as_completed() - Use
from control_arena._async_utils import run_syncinstead ofasyncio.run()for sync-to-async entry points - Use
anyio.open_process()instead ofasyncio.create_subprocess_exec()(and catchanyio.EndOfStreamwhen reading from process streams) - Use
anyio.to_thread.run_sync()instead ofloop.run_in_executor() - Use
anyio.fail_after()instead ofasyncio.wait_for() - Use
anyio.Semaphore()instead ofasyncio.Semaphore() - See
control_arena/_async_utils.pyfor available utilities
- Use
Git Conventions
- Branch naming:
<username>/<type>/<description>in kebab-case (e.g.alice/feat/add-new-setting,bob/fix/monitor-timeout) - Commit messages: Use Conventional Commits --
<type>: <description>. Common types:feat,fix,docs,refactor,chore,test. Use!for breaking changes (e.g.feat!: Change sample ID format).
Respect existing code patterns when modifying files. Run linting before committing changes.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 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.
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- docs/llms.txtllms.txt
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.

