cloud-harness-mcp
AGENTS.md115 starsChanged 4 months agoMITView on GitHub
Cloud Harness MCP is intentionally a private, single-owner remote coding harness. Preserve that threat model: it permits arbitrary repository-controlled execution inside a constrained executor, but it is not a hostile multi-tenant sandbox. Start with README.md. Read the relevant document under docs/ before changing its boundary. Code, schemas, tests, manifests, and scripts own WHAT and HOW; documentation owns WHY and WHERE. Point docs to executable owners instead of copying behavior, defaults, command inventories, or configuration. - Keep the credential-free ingress proxy…
- 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 repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- site/llms.txtllms.txt
- cloudharnessSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
19 rules. About 2 are common, 7 are distinctive, and 10 are very specific to this project.
≈2
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
10
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 10
Start with README.md. Read the relevant document under docs/ before changing its boundary.
- Common: line 34
Keep the credential-free ingress proxy as the only host-published Compose service, bound to loopback.
- Common: line 37
Keep Docker authority, job/state mounts, and optional GitHub App credentials confined to the runner.
- Very specific: line 56
Treat the schemas and result envelope in packages/contracts/src/ and the lifecycle, idempotency, restart, and truncation semantics in …
- Very specific: line 63
Never commit .env files, tokens, keys, databases, runtime state, private repository URLs, or user data.
- Distinctive: line 66
Treat bootstrap, deployment, rollback, production verification, and manual container or state recovery as live operations.
- Very specific: line 80
Every security rule still applies to both shells: no unsafe-inline, no unsafe-eval, no CDN or remote assets, no secret, API key, OAuth …
- Very specific: line 119
Before starting an issue, check its labels, assignees, and linked PRs.
- Distinctive: line 128
When you find a related or duplicate issue, comment on it with a reference to the issue you are working on instead of duplicating work.
- Distinctive: line 137
Keep changes narrow and preserve public contracts unless the accepted scope intentionally changes them.
- Distinctive: line 139
Run the narrowest relevant test first, then the applicable repository gate:
- Distinctive: line 155
Do not weaken security checks, cleanup assertions, timeouts, or tests to make a gate pass.
- Distinctive: line 157
If you start watch processes or Compose services, check for an existing project process first, track what you start, and stop it when the …
- Very specific: line 160
Use npm ci for a clean dependency install.
- Very specific: line 176
Update .agents/skills/cloudharness/SKILL.md and the affected reference documents under .agents/skills/cloudharness/references/ to keep …
- Very specific: line 179
Run npm run plugin:sync to ensure .agents/skills/cloudharness/ and plugins/cloud-harness/skills/cloudharness/ remain byte-identical.
- Very specific: line 181
Verify skill contract compliance by running npm test packages/contracts/test/cloudharness-skill-contract.test.ts (or npm run verify).
- Very specific: line 195
Before starting, check for an existing in progress owner or a duplicate issue.
- Distinctive: line 202
Keep plans and reports out of evergreen guidance, and do not add release notes or governance files unless the repository contract requires …
≈ “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
Cloud Harness MCP collaborator guide
Purpose and authority
Cloud Harness MCP is intentionally a private, single-owner remote coding harness. Preserve that threat model: it permits arbitrary repository-controlled execution inside a constrained executor, but it is not a hostile multi-tenant sandbox.
Start with README.md. Read the relevant document under docs/
before changing its boundary. Code, schemas, tests, manifests, and scripts own
WHAT and HOW; documentation owns WHY and WHERE. Point docs to executable owners
instead of copying behavior, defaults, command inventories, or configuration.
Navigation
| Concern | Read first | Executable authority and evidence |
| Trust model and isolation | docs/security-model.md | apps/api/src/request-security.ts, apps/runner/src/workspace-service.ts, test/integration/docker-sandbox.docker.test.ts |
| Public MCP contract | docs/mcp-api.md | packages/contracts/src/, apps/api/src/mcp-server.ts, packages/contracts/test/, test/integration/ |
| MCP Events (webhook delivery) | docs/mcp-api.md, docs/security-model.md | packages/contracts/src/events-api.ts, apps/api/src/events/, apps/runner/src/event-outbox.ts, apps/runner/src/mcp-event-service.ts, test/integration/mcp-events-http.test.ts |
| API/runner boundary | docs/system-architecture.md | apps/api/src/, apps/runner/src/, compose*.yaml, scripts/verify-compose-boundaries.mjs |
| Repository and executor behavior | docs/security-model.md | apps/runner/src/repository-policy.ts, worker/, runner and Docker tests |
| Configuration | docs/configuration.md | .env.example, packages/contracts/src/config.ts, apps/api/src/config.ts, apps/runner/src/config.ts, compose*.yaml |
| Development and verification | docs/development.md | package.json, .github/workflows/ci.yml, tests |
| Deployment and recovery | docs/deployment.md, docs/operations.md, docs/troubleshooting.md | deploy/, compose.production.yaml, scripts/verify-production.mjs, scripts/deploy-canary.mjs |
| Operator dashboard UI (legacy shell) | docs/design-guidelines.md | apps/api/dashboard/, apps/api/src/dashboard-router.ts, apps/api/src/dashboard-assets.ts, apps/api/test/dashboard-ui-contract.test.ts |
| Dashboard 2.0 (React app) | docs/adr/0005-dashboard-react-rewrite.md, docs/dashboard-parity-matrix.md, docs/design-guidelines.md | apps/dashboard/, apps/api/src/dashboard-react-assets.ts (manifest serving), apps/api/src/dashboard-security.ts (CSP), apps/api/src/dashboard-router.ts (BFF) |
| Official user docs & guides | docs-site/ | docs-site/, scripts/build-docs-reference.mjs, npm run docs:build |
| Agent skill & MCP tool guidance | .agents/skills/cloudharness/SKILL.md | .agents/skills/cloudharness/, plugins/cloud-harness/, packages/contracts/test/cloudharness-skill-contract.test.ts, npm run plugin:sync |
Safety-critical invariants
- Keep the credential-free ingress proxy as the only host-published Compose service, bound to loopback. The API and runner must not publish host ports; the ingress must not receive secrets or join the control network.
- Keep Docker authority, job/state mounts, and optional GitHub App credentials
confined to the runner. The API must not receive host mounts or the Docker
socket. Executors must not receive control-plane credentials, and the harness
must not push repository credentials into them. The single documented
exception is an operator-created GitHub runtime secret (
GH_TOKENorGITHUB_TOKEN), which is an explicit owner opt-in for authenticating the workspaceghCLI and is recorded indocs/security-model.md. - Preserve the executor restrictions and resource bounds owned by
apps/runner/src/workspace-service.ts.dependency-accessis the owner-approved shipped network default andnetwork-noneremains the isolation opt-out, per workspace or instance-wide; the executable owners anddocs/security-model.mdown the resolution order, the per-start attestation requirement, and the fail-closedDEPENDENCY_EGRESS_UNAVAILABLEbehaviour. No rawbridgeprofile is selectable, and egress is never a silent downgrade. - Preserve credential-free HTTPS repository URLs, host/address validation, and constrained cloning. Private-clone credentials stay in the trusted broker and must never persist in the checkout, remote URL, logs, fixtures, or command output; the executor-environment exception is the operator-injected GitHub runtime secret named above.
- Treat the schemas and result envelope in
packages/contracts/src/and the lifecycle, idempotency, restart, and truncation semantics indocs/mcp-api.mdas public contracts. Change their source, tests, and user guidance together. - Scope cleanup by the verified workspace identity, canonical job path, state record, and managed-container labels. Never recursively remove a jobs root or run broad Docker cleanup on a shared host.
- Never commit
.envfiles, tokens, keys, databases, runtime state, private repository URLs, or user data. Do not claim live private-clone or production verification without owner-authorized, sanitized evidence. - Treat bootstrap, deployment, rollback, production verification, and manual container or state recovery as live operations. Follow the owning runbook, resolve exact targets first, and do not perform them from an ordinary code task without explicit authorization.
Dashboard frontend rules
ADR 0005 supersedes Issue #220's
"no framework" decision. Do not re-apply the old frontend-only rules to
apps/dashboard: React, TypeScript, the ADR's dependency allowlist,
self-hosted Geist fonts under font-src 'self', and browser storage for
non-secret preferences and UI restore are allowed there. The legacy shell in
apps/api/dashboard/ keeps its own rules and contract tests until cutover.
Every security rule still applies to both shells: no unsafe-inline, no
unsafe-eval, no CDN or remote assets, no secret, API key, OAuth token,
terminal output or owner ID in browser storage or persisted caches, the BFF
session cookie and CSRF header on every mutation, Host/Origin checks, and
redacted principal-scoped projections. A UI affordance never grants a
capability. Replace a markup-coupled test with a behavioural test when its
page moves; never delete coverage. Track page ownership in the
parity matrix.
Deploy failure lessons
- A
Deploy productionfailure atdeploy-canary.mjswithUND_ERR_CONNECT_TIMEOUT/ECONNREFUSEDright aftercompose upis usually a transient route gap in the freshly recreated container, not a release bug. Confirm from the host (docker exec cloud-harness-mcp-ingress-1 node -e ...TCP probe to the canary host) before changing code; the canary retries only its first side-effect-freeserver/discovercall on transport errors. Never read or print the canary credentials file while diagnosing. - The
curl ... port 3100lines before the canary are the expected readiness wait loop, not the failure. client_loop: send disconnect: Broken pipemid-build means the CI session dropped. Check the host withsystemctl status cloud-harness-deploy-<sha>and its journal, not the CI log: the deploy runs as that systemd unit and keeps going. Never move the deploy back into the SSH/sudo session; sudo kills the process group before any rollback trap can run.- The installed
/usr/local/sbin/cloud-harness-deployis the previous release's script, so a fix todeploy-release.shprotects only later deploys. Deploying an older commit never downgrades it (/var/lib/cloud-harness/deploy-tooling-release). - A leftover
/var/lib/cloud-harness/deploy-in-progressmeans a deploy was killed after stopping the release;cloud-harness-deploy-recover.service(boot) or the deploy unit'sExecStopPostrolls it back. Do not delete the marker by hand before reading its journal.
Issue and PR coordination
Parallel contributors and agents coordinate through issue state, so keep it current:
- Before starting an issue, check its labels, assignees, and linked PRs. Skip or
coordinate on an issue already
in progress,in review, ordone. - Assign yourself (or the requesting owner) and move the issue through exactly
one status label at a time:
in progresswhile implementing,blockedwhen waiting on an external decision or prerequisite (comment what blocks it),in reviewduring isolated code review,doneonce the PR is open and green, andshippedafter it merges tomain. mainis the integration branch; merging to it triggersDeploy production, so a merge is a live operation that needs owner authorization.- When you find a related or duplicate issue, comment on it with a reference to the issue you are working on instead of duplicating work. File an unrelated defect you discover as its own issue rather than widening the current PR.
Change workflow
- Inspect the relevant document, executable owner, nearby tests, and current working tree. Preserve unrelated edits.
- For defects, prove the failure and its boundary before changing behavior. Keep changes narrow and preserve public contracts unless the accepted scope intentionally changes them.
- Run the narrowest relevant test first, then the applicable repository gate:
- Normal code changes:
npm run verify. On Windows or non-POSIX hosts, use targeted suites (npm run test:unit,npm run test:integration,npm run lint,npm run typecheck) as your baseline; shell fixture tests intest/deploy-release-runtime.test.tsandtest/upgrade-nginx-routes.test.tsrequire a POSIX host and are verified in Linux CI. The nginx upgrade script refuses its test root when run as root, so in a root-only container run that suite as an unprivileged user instead of treating the failure as a regression. - Compose or network-boundary changes:
npm run verify:composeandnpm run verify. - Shell changes: run the syntax check owned by
.github/workflows/ci.yml. - Docker/executor changes: build with
docker compose --profile images build executor-image api runner, then runnpm run test:dockerandnpm run test:e2ewhen Docker and network access are available.
- Normal code changes:
- Do not weaken security checks, cleanup assertions, timeouts, or tests to make a gate pass. Report an unavailable prerequisite or pre-existing failure.
- If you start watch processes or Compose services, check for an existing project process first, track what you start, and stop it when the task ends.
Use npm ci for a clean dependency install. The root package.json remains the
command authority; do not duplicate its full script list here. Do not run
npm run verify:production casually: it targets a live MCP endpoint, requires
owner credentials, and creates a disposable workspace.
Whenever shipping changes with user or operational impact (new features,
workflows, configuration keys, public contracts, troubleshooting steps, or use
cases), evaluate and update both internal docs (docs/) and the official docs
site (docs-site/). Keep user and operator guides in sync (such as
docs-site/ai-tools/, docs-site/dashboard/, docs-site/reference/, and
docs-site/troubleshooting.md), and run npm run docs:reference or
npm run plugin:sync if tool or contract surfaces changed.
Whenever MCP tool surfaces, schemas, capabilities, options, execution behaviors, or workspace lifecycle features change or are added:
- Update
.agents/skills/cloudharness/SKILL.mdand the affected reference documents under.agents/skills/cloudharness/references/to keep agent tool usage guidance accurate and effective. - Run
npm run plugin:syncto ensure.agents/skills/cloudharness/andplugins/cloud-harness/skills/cloudharness/remain byte-identical. - Verify skill contract compliance by running
npm test packages/contracts/test/cloudharness-skill-contract.test.ts(ornpm run verify).
Issue coordination
Parallel contributors and agents coordinate through issue labels, so keep them current on the issue you are working on and assign its owner:
in progresswhile implementing,blockedwhile waiting on a dependency or decision (say what in a comment),in reviewwhile an isolated reviewer checks the change,doneonce the PR is open, andshippedonce it is merged. Replace the previous state label rather than stacking them. Thereleasedlabel is applied by the release automation, not by hand.- Before starting, check for an existing
in progressowner or a duplicate issue. Comment on related or duplicate issues with a reference instead of doing the work twice. - File a separate issue for an unrelated defect or hardening gap found along the way rather than widening the current PR, and resolve it instead of leaving it for later.
Keep plans and reports out of evergreen guidance, and do not add release notes or governance files unless the repository contract requires them.
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.

