Deterministic authority infrastructure for developers
Developer API · Early Access
Build AI agents that can propose production changes without holding independent production authority.
Your application submits a proposal. CommerceGov evaluates deterministic policy, records the decision of an authorized human, and issues one exact, single-use authorization. Your own executor applies the change in your environment and reports the outcome back as evidence.
Capability ≠ Authority ≠ Applied ≠ Verified.
Availability. The Developer API is in Early Access. The contract on this page has been implemented and exercised end to end in an isolated local test environment. It is not generally available, it is not deployed to production, and there is no self-service sign-up. Paths and payloads may change before release.
The execution-report and status endpoints are pending integration of a project-scoping fix.
Overview
The Developer API places a CommerceGov authority boundary between an AI agent and a production change that you execute yourself.
It is intended for:
- Developers building AI agents that suggest production changes.
- SaaS platforms that want an explicit human decision before an agent-proposed change runs.
- Internal engineering teams adding governance to production changes.
The agent can propose a change. It cannot approve its own proposal, and a consumed authorization cannot be replayed to gain further execution authority. CommerceGov does not execute arbitrary developer production changes on the agent's behalf. You control the executor that makes the change.
Architecture
Each layer records its own fact. No layer infers another.
- AI / application capabilitySubmits a proposal with a proposal credential. A proposal is data, not authority.
- Deterministic policyA fixed, fingerprinted per-project policy admits the proposal to Review or denies it. No model is involved.
- Human authorityAn authorized project approver approves or rejects the exact proposal, identified by its payload digest, in the CommerceGov Admin UI Review tab.
- Developer-controlled executionYour executor validates the authorization and consumes it once, then applies the authorized effect in your own environment.
- Developer-reported outcomeYour executor reports
succeeded,failedorunknown. CommerceGov stores the report asdeveloper_reportedevidence. - Independent verificationNot part of this path. CommerceGov does not read your production system back.
Getting started
During Early Access, the CommerceGov team handles onboarding. There is no public registration endpoint and no key-generation portal.
- You request Early Access and describe the change you want governed.
- CommerceGov creates a developer project for an authenticated human project owner. Project IDs look like
dpr_followed by 32 hex characters. - The project owner names the human approvers and a policy owner. The policy owner configures the project's policy once. The policy cannot be changed afterwards.
- The project owner issues credentials, separately for proposal and for execution. Each secret is shown once. CommerceGov stores only its SHA-256 hash.
Authentication and permissions
Machine calls use Authorization: Bearer <secret>, where a project credential secret starts with cgdev_. Every credential is bound to exactly one project.
| Principal | Scopes | Can | Cannot |
|---|---|---|---|
| Proposal credential | proposals:write, proposals:read, evidence:read | Submit proposals; read proposal status and evidence | Approve, validate, consume or report |
| Execution credential | executions:validate, executions:report | Validate and consume an approved authorization; report the outcome | Propose or approve |
| Human session | Project approver role | Approve or reject the exact proposal in the Admin UI Review tab | Act through a bearer credential |
A credential's scopes must be a subset of its type's scopes. The report must come from the execution credential that validated and consumed the authorization, so that credential needs both execution scopes.
First governed change
An AI agent proposes raising config/max_parallel_jobs from 2 to 3. Your configuration store is at version 7, and the authorized write produces version 8.
Supported mutation class in v1: config.set on config/max_parallel_jobs or config/max_retry_attempts, with an integer value. Retry attempts range from 0 to 2,147,483,647 and require a separately configured, immutable project policy with explicit bounds; no policy means no admission. The active project policy owner configures those bounds in the existing Review tab. Retry admission is disabled by default until explicitly enabled by the operator. Each resource has independent Review supersession. Other actions, resources and extra fields are rejected. Request bodies are limited to 2,048 bytes.
All machine routes are under the base path /api/integration/v1/developer/projects/{project_id}.
1. Propose (proposal credential, proposals:write)
POST /api/integration/v1/developer/projects/{project_id}/proposals
{
"action": "config.set",
"resource": "config/max_parallel_jobs",
"payload": {"value": 3},
"expected_version": 7,
"idempotency_key": "agent-run-2026-11-16-0001"
}
Response 201 (200 on idempotent replay):
{
"project_id": "dpr_…",
"proposal_id": "dpp_…",
"status": "review_pending",
"policy_status": "pass",
"policy_ref": "…",
"policy_version": 1,
"payload_digest": "<64 hex>",
"idempotent_replay": false
}
The project's deterministic policy admits values within its configured bounds (at most 1–5). A value outside them is still recorded, with "status": "policy_denied" and "policy_status": "deny". A denied proposal can never be approved or executed. This route never approves, claims or executes anything.
2. Review and approve (human session)
An authorized approver opens the project in the Admin UI Review tab and approves the exact proposal, identified by its payload_digest. Only the newest pending proposal for each resource within a project can be decided. A newer proposal for the same resource supersedes older proposals; proposals for different resources remain independent. An approval is valid for 15 minutes.
GET /api/ui/admin/html?project_id={project_id}&tab=review
POST /api/ui/admin/developer/projects/{project_id}/proposals/{proposal_id}/decision
These routes require a signed-in human session and a CSRF token. Bearer credentials are refused.
3. Validate (execution credential, executions:validate)
POST /api/integration/v1/developer/projects/{project_id}/authorizations/validate
{
"proposal_id": "dpp_…",
"execution_id": "exec-2026-11-16-0001",
"action": "config.set",
"resource": "config/max_parallel_jobs",
"payload": {"value": 3},
"expected_version": 7
}
Validation binds the approved proposal to your execution_id and this credential for 60 seconds. It does not grant execution. Response 201 (200 on replay):
{
"proposal_id": "dpp_…",
"execution_id": "exec-2026-11-16-0001",
"status": "claimed",
"authorization_granted": false,
"payload_digest": "<64 hex>",
"expires_at": "…",
"idempotent_replay": false
}
4. Consume (execution credential, executions:validate)
POST /api/integration/v1/developer/projects/{project_id}/authorizations/consume
Send the same body as Validate. The first successful consume returns 201 with the one authorized effect:
{
"proposal_id": "dpp_…",
"execution_id": "exec-2026-11-16-0001",
"status": "consumed",
"authorization_granted": true,
"consumed_at": "…",
"effect": {
"action": "config.set",
"resource": "config/max_parallel_jobs",
"payload": {"value": 3},
"expected_version": 7,
"payload_digest": "<64 hex>",
"policy_ref": "…",
"policy_version": 1
}
}
Any later consume of the same authorization returns 200 with "authorization_granted": false and no effect. Execute only when authorization_granted is true.
5. Execute (your executor, your environment)
Your executor applies effect as a compare-and-set: write 3 only if the current version is still 7, which produces version 8. CommerceGov binds expected_version into the authorization, but it cannot see your store. Your executor must refuse the write if the version has moved.
6. Report (execution credential, executions:report)
POST /api/integration/v1/developer/projects/{project_id}/executions/reports
{
"proposal_id": "dpp_…",
"execution_id": "exec-2026-11-16-0001",
"action": "config.set",
"resource": "config/max_parallel_jobs",
"payload": {"value": 3},
"expected_version": 7,
"payload_digest": "<64 hex>",
"outcome": "succeeded",
"evidence": {"observed_value": 3, "observed_version": 8}
}
Response 201 (200 on an identical replay):
{
"report_id": "dprpt_…",
"evidence_id": "dpe_…",
"execution_id": "exec-2026-11-16-0001",
"proposal_id": "dpp_…",
"outcome": "succeeded",
"verification_source": "developer_reported",
"reported_at": "…",
"idempotent_replay": false
}
7. Read status and evidence (proposal credential, evidence:read)
GET /api/integration/v1/developer/projects/{project_id}/proposals/{proposal_id}/status
Returns the proposal's lifecycle in one record: proposal_status, payload_digest and expected_version; decision, decided_at and approval_expires_at; execution_id, claimed_at and consumed_at; and report_id, evidence_id, outcome, evidence, verification_source and reported_at.
Error handling
Machine-route errors use one envelope: {"error": {"code", "message", "retryable", "request_id", "retry_after_seconds"}}.
| Situation | Result |
|---|---|
| Missing bearer credential | 401 authentication_required |
| Unknown or revoked credential, wrong credential type or scope, disabled project, or a credential from a different project | 403 authorization_denied. The same refusal is returned in every case, so project existence is not revealed. |
| Malformed body, extra field, or a different action or resource | 400 validation_failed (400 invalid_proposal on proposal admission) |
| Body over 2,048 bytes | 413 request_too_large |
| More than 30 proposal or validate requests per minute per credential | 429 rate_limited with retry_after_seconds |
| Project policy not configured or fingerprint mismatch | 503 policy_unavailable |
| Policy denial | Not an error. 201 with "status": "policy_denied"; the proposal cannot be approved or executed. |
| Stale proposal: a newer proposal exists for the same project and resource | The older proposal cannot be decided; validate and consume return 409 concurrent_modification |
| Approval older than 15 minutes, or validation older than 60 seconds | 409 concurrent_modification |
| Proposal credential revoked, or the approving human no longer an approver | The outstanding authorization becomes invalid: 409 concurrent_modification |
Exact-effect mismatch: value or expected_version differs from the approved proposal | 409 concurrent_modification |
| Rejected proposal, or consume or report without a matching validation or consumption | 409 concurrent_modification |
| Unknown proposal | 404 proposal_not_found |
| Idempotent replay | Proposal with the same key, payload and credential: 200. Validate with the same execution_id and credential: 200. Consume again: 200 with "authorization_granted": false. Identical report: 200 with the original report_id and evidence_id. |
| Same idempotency key with a different payload or credential | 409 idempotency_conflict |
| Conflicting execution report: a different outcome or evidence for an already-reported execution | 409 concurrent_modification; the first report stands |
Evidence and verification
Each state is a separate record.
- Authorization consumed. CommerceGov recorded that one execution credential consumed one exact authorization, once.
- Developer reported. Your executor stated that the change
succeeded,failedor endedunknown. - Recorded as
verification_source = developer_reported. This is the only verification source this path writes. - Not independently verified. This v1 developer-reporting path does not read your production system back. A report is your executor's statement, not CommerceGov-verified production state.
The end-to-end proof of this contract ran against an isolated local configuration fixture. It is not a demonstrated production integration.
Request Early Access
Tell us which agent you are building and which production change you want governed. Early Access is arranged with the CommerceGov team. It does not grant immediate production API access.