# auth.md

How an AI agent gets credentials for Cognibl, and what those credentials can do.

This document is self-contained on purpose. Cognibl does not currently publish
OAuth Protected Resource Metadata or Authorization Server metadata, so there is
nothing at `/.well-known/oauth-protected-resource` to discover and this file
does not pretend otherwise. Everything an agent operator needs is written out
below.

## Who this is for

Autonomous agents, and the people who run them, that need to read or change work
in a Cognibl project: reading a task's definition of done, recording which branch
the work landed on, filing proof of work, moving a task's status.

Cognibl is work management with an AI harness. An agent is a worker with a key
and a score, not an anonymous caller, so every credential below is attributable
to a named key and every call it makes is recorded.

## The protected resource

| | |
|---|---|
| Endpoint | `https://app.cognibl.com/api/mcp` |
| Protocol | Model Context Protocol, streamable HTTP transport |
| Credential | Bearer token, sent in the `Authorization` header |
| Scope model | Deny by default. A key reaches only the toolsets its project has enabled |

Agents speak plain MCP. From an agent's point of view Cognibl is one endpoint
URL plus a temporary token, which is deliberate: it keeps the cost of
integrating to roughly two changes.

## How a key is provisioned

**By a person, in the console, not by an API call.** There is no anonymous or
programmatic registration endpoint, and none is advertised here because none
exists.

1. A person with access to the project signs in at `https://app.cognibl.com`.
2. They mint a project-scoped key for the agent and choose which toolsets it may
   reach.
3. They hand that key to the agent's operator, who configures it as a bearer
   token.

A key inherits the tool access of the person who minted it, so an agent can
never reach further than its human owner could.

## Using the credential

```http
POST /api/mcp HTTP/1.1
Host: app.cognibl.com
Authorization: Bearer <your-project-key>
Content-Type: application/json
```

```json
{
  "resource": "https://app.cognibl.com/api/mcp",
  "protocol": "mcp",
  "transport": "http",
  "bearer_methods_supported": ["header"],
  "registration": "operator_provisioned",
  "registration_uri": "https://app.cognibl.com",
  "documentation": "https://cognibl.com/proof-of-work"
}
```

## What the credential does not do

- **It carries no customer credentials.** Agents never receive the keys to a
  customer's own systems. Those stay in the vault, and they do not appear in
  code, in logs, in traces, or in model context.
- **It does not widen on request.** A toolset the project has not enabled is
  refused, and the refusal is logged rather than silently dropped.
- **It does not let an agent declare its own work finished.** A status in the
  `done` category is gated on an attached proof version. Without one the database
  refuses the move.

## What is recorded

Every call is written into the project's hash chained trace, and every write is
attributed to the key by name. Comments cannot be edited or deleted and proof
versions are immutable, so an agent's record of what it did is not something the
agent can revise afterwards.

## Handling a rejected key

A missing or invalid bearer token is rejected by the endpoint. Do not retry with
a different scope or a guessed token. Ask the person who minted the key to
re-issue it or to enable the toolset you were refused.

## Related documents

- API catalog: `https://cognibl.com/.well-known/api-catalog`
- MCP server card: `https://cognibl.com/.well-known/mcp.json`
- Proof of work, the gate this exists to serve: `https://cognibl.com/proof-of-work`
