Gate a GitHub write by an agent
Admit an agent's write to a repository through Intralock and post the verdict to the commit as a check run or status.
github.enforce
Admit an agent's write to a repository through Intralock and post the verdict to the commit as a check run or status.
github.enforcePut admission in front of your MCP servers, repositories, SaaS tools and cloud accounts. Every agent gets a lease or a reason – and you keep the lever to stop any of them.
An agent writes to a repository and you want the write decided, with the verdict on the commit. A write that needs confirmation is refused until an approver issues a token.
The code reads the key from INTRAMEDIAL_KEY. Keep it in your shell or your secret store, never in a file you commit. Calls that need a signed-in person cannot use a key: the console makes them.
Send the repository, the agent, the commit sha and the verb. Admission is per repository; action defaults to write.
github.enforcegithub-enforce
curl -sS -X POST https://api.intramedial.com/api/v1/acp/github/enforce \
-H "Authorization: Bearer $INTRAMEDIAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"repo": "acme/payments",
"actorDid": "did:web:acme.example:agent:billing",
"sha": "9fceb02d0ae598e95dc970b74767f19372d61af8",
"action": "write"
}'const res = await fetch("https://api.intramedial.com/api/v1/acp/github/enforce", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.INTRAMEDIAL_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
repo: "acme/payments",
actorDid: "did:web:acme.example:agent:billing",
sha: "9fceb02d0ae598e95dc970b74767f19372d61af8",
action: "write",
}),
});
console.log(res.status, await res.json());import os, requests
res = requests.post(
"https://api.intramedial.com/api/v1/acp/github/enforce",
headers={"Authorization": "Bearer " + os.environ["INTRAMEDIAL_KEY"]},
json={
"repo": "acme/payments",
"actorDid": "did:web:acme.example:agent:billing",
"sha": "9fceb02d0ae598e95dc970b74767f19372d61af8",
"action": "write",
},
timeout=30,
)
print(res.status_code, res.json())allow is false with confirmation_required until an approver issues a token. A GitHub App posts it as the intramedial/acp check.
{
"allow": false,
"llm": false,
"reason": "confirmation_required",
"sha": "9fceb02d0ae598e95dc970b74767f19372d61af8",
"repo": "acme/payments",
"commitStatus": null,
"checkRun": { "id": "4417203551", "url": "https://github.com/acme/payments/runs/4417203551" }
}In branch protection, require the intramedial/acp check. Without it the check shows but blocks no merge. Pull request and merge group events enforce; a push only records.
Copied from: /docs/github-enforce
The ledger is append-only and sealed under Merkle roots. The time on an entry is Intramedial's own clock, and a signed bundle can be checked offline with the published key.
Let a refused write wait in the approval queue until a signed-in person approves it, then retry with the token.
coordination.approveAsk the MCP gateway for Intralock's verdict on an agent's tool call, read the reason, and list the callers it has seen.
mcp.enforceAsk the plane whether an agent may act on a connected SaaS source, and read the verdict before anything is sent.
saas.admitOne short email when we add recipes to the cookbook. No other mail, and you can unsubscribe from any message.
No key or account: Try it on the coordination.admit module page runs the real kernel in your browser. Use a workspace key for your own workspace.