foreman
AGENTS.md11 starsChanged 2 months agoMITView on GitHub
Foreman is a local-first security gateway for developer agents. It mediates tool calls before they run, applies policy and risk scoring, asks for approval when needed, and retains a local audit trail. This file is for any coding agent or automated contributor working in this repository. Read it before proposing a change. 1. Read README.md for the product and CONTRIBUTING.md for the contribution contract. 2. Read FOREMAN.md before changing core behavior. Read FOREMAN-TUI.md before changing src/tui/. 3. Find a scoped…
- Reads credentials
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 33,398 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 repositoryOne other file it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
13 rules. About 1 is common, 7 are distinctive, and 5 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈7
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
- could be automatic: a setting could enforce it
- Very specific: line 12
Read README.md for the product and CONTRIBUTING.md for the contribution contract.
- Very specific: line 14
Read FOREMAN.md before changing core behavior.
- Distinctive: line 36
Use Node 22.12 or later and run the checks relevant to the change:
- Distinctive: line 51
Run the TUI against an isolated state directory.
- Common: line 61
Do not weaken approval, identity, policy, audit, or secret-handling behavior to make a test or demo pass.
- Very specific: line 63
Do not add real credentials, tokens, private keys, .env contents, or machine-specific paths to the repository, issues, PRs, fixtures, or …
- Distinctive: line 65
Do not change GitHub Actions, release code, install scripts, or dependency versions unless the issue explicitly requires it.
- Very specific: line 68
Do not use pull_request_target with a checkout of untrusted PR code.
- Distinctive: line 69
Do not introduce a dependency without explaining why an existing dependency cannot do the job.
- Distinctive: line 75
Keep one logical issue per PR.
- Very specific: line 77
Use strict TypeScript and ESM.
- Distinctive: line 78
Follow neighboring code instead of inventing a new local pattern.
- Distinctive: line 79
Update documentation when an installation command, public CLI behavior, configuration shape, or supported integration changes.
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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
Foreman agent guide
Foreman is a local-first security gateway for developer agents. It mediates tool calls before they run, applies policy and risk scoring, asks for approval when needed, and retains a local audit trail.
This file is for any coding agent or automated contributor working in this repository. Read it before proposing a change.
Start here
- Read
README.mdfor the product andCONTRIBUTING.mdfor the contribution contract. - Read
FOREMAN.mdbefore changing core behavior. ReadFOREMAN-TUI.mdbefore changingsrc/tui/. - Find a scoped issue. Prefer issues labelled
agent-ready,good first issue, orhelp wanted. If the change is not a tiny bug fix, discuss its plan in an issue before editing code. - Work from a fork and open a pull request. Never assume direct push or merge permission.
Repository map
| Area | Location | Notes |
| CLI commands | src/cli/ | Keep commands small and composable. |
| Core policy, mediation, identity and audit | src/core/ | Security-sensitive: preserve fail-closed behavior. |
| MCP transport | src/mcp/ | Treat untrusted input as hostile. |
| Terminal UI | src/tui/ | Follow FOREMAN-TUI.md; report manual smoke testing in the PR. |
| Bundled integration catalog | registry/ | Keep schema, entry and snippet changes together. |
| Tests | tests/ | Add a focused regression test for behavior changes. |
| User documentation | docs/, examples/ | Commands and examples must be runnable. |
Required checks
Use Node 22.12 or later and run the checks relevant to the change:
npm ci
npm run lint
npm test
npm run buildFor registry changes, also run:
node dist/cli/index.js registry validateRun the TUI against an isolated state directory; never point exploratory work at a real user state directory:
FOREMAN_HOME=./.foreman-dev node dist/cli/index.js init
FOREMAN_HOME=./.foreman-dev node dist/cli/index.js startNon-negotiable security boundaries
- Do not weaken approval, identity, policy, audit, or secret-handling behavior to make a test or demo pass.
- Do not add real credentials, tokens, private keys,
.envcontents, or machine-specific paths to the repository, issues, PRs, fixtures, or logs. - Do not change GitHub Actions, release code, install scripts, or dependency versions unless the issue explicitly requires it. Explain the security and supply-chain impact in the PR.
- Do not use
pull_request_targetwith a checkout of untrusted PR code. - Do not introduce a dependency without explaining why an existing dependency cannot do the job.
Change discipline
- Make the smallest change that satisfies the issue's acceptance criteria.
- Keep one logical issue per PR. Do not mix refactors, formatting sweeps, and product behavior in one change.
- Use strict TypeScript and ESM. Do not use
anyoutside test files. - Follow neighboring code instead of inventing a new local pattern.
- Update documentation when an installation command, public CLI behavior, configuration shape, or supported integration changes.
Pull request handoff
The PR body must state: linked issue, what changed, tests run, security impact
(none is acceptable), and any manual TUI verification. Mark uncertain work
as a draft rather than presenting it as ready to merge.
Maintainers review and merge every contribution. Passing CI is necessary, not sufficient, for changes that affect security boundaries.
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.

