AI agents
Agent quickstart
Connect an external coding agent or orchestrator without giving it Deploy Hatch database, worker, Docker, or source access.
1. Create the target project normally and connect its GitHub repository
Create the target project normally and connect its GitHub repository. Persist the trusted runtime, service type, and command configuration required by the workload.
2. Open the project's Agent credentials page and create a scoped credential
Open the project's Agent credentials page and create a scoped credential. Common integrations need deployment:read and deployment:create; add deployment:retry or configuration scopes only when the agent is authorized to use those capabilities.
3. Fetch GET https://deployhatch
Fetch GET https://deployhatch.com/api/agent/capabilities without authentication. Read schemaVersion and discover routes, methods, scopes, mutation schemas, lifecycle semantics, recovery limits, dispatch rules, and invariants from the response.
4. Authenticate machine requests with Authorization: Bearer <agent-credential>
Authenticate machine requests with Authorization: Bearer <agent-credential>. Never commit or log the credential.
5. Discover the workload at an immutable revision
Discover the workload at an immutable revision. Bind every placeholder advertised by the endpoint route. Treat repository inspection as untrusted advisory input and require persisted configuration before deployment.
6. Create a deployment using the contract's deploy mutation schema and a fresh idempotency key
Create a deployment using the contract's deploy mutation schema and a fresh idempotency key. Preserve the returned deployment ID and immutable revision.
7. Observe that exact deployment
Observe that exact deployment. On running, verify the public machine health signal before returning healthy. On failure, read that deployment's diagnostics and follow the advertised recovery disposition.
8. For retries of the same logical mutation, reuse its idempotency key
For retries of the same logical mutation, reuse its idempotency key. For a new logical mutation, generate a new key. Never implement an unbounded recovery loop.