# Syncogia auth.md

This document defines agent registration and authentication mechanisms for autonomous AI agents, assistants, and personal agents interacting with Syncogia APIs and resources.

## 1. Audience

This document is intended for:
- Personal AI agents (e.g., Personal Agent Protocol / Poppy compliant agents).
- Autonomous tool-use agents (e.g., Model Context Protocol / MCP clients).
- Automated services requesting user-delegated or machine-to-machine access.

## 2. Discovery Endpoints

Syncogia publishes RFC-compliant discovery metadata:
- **OAuth Protected Resource Metadata (RFC 9728)**: `https://syncogia.com/.well-known/oauth-protected-resource`
- **OAuth Authorization Server Metadata (RFC 8414)**: `https://syncogia.com/.well-known/oauth-authorization-server`
- **OpenID Connect Discovery**: `https://syncogia.com/.well-known/openid-configuration`
- **JSON Web Key Set (JWKS)**: `https://syncogia.com/.well-known/jwks.json`

## 3. Agent Registration (`agent_auth`)

Agents can programmatically register or establish sessions via the registration endpoint:
- **Registration URI (`register_uri`)**: `https://syncogia.com/agent/auth`
- **Claim URI (`claim_uri`)**: `https://syncogia.com/agent/claim`
- **Revocation URI (`revocation_uri`)**: `https://syncogia.com/oauth/revoke`

### Supported Identity & Authentication Methods

1. **Identity Assertion (ID-JAG)**
   - Type: `identity_assertion`
   - Assertion Type: `urn:ietf:params:oauth:token-type:id-jag`
   - Credential Type: `bearer_token`
   - Use Case: Cross-domain agent identity chaining where an agent presents a cryptographically signed identity token from a trusted identity provider.

2. **Verified Email Assertion**
   - Type: `identity_assertion`
   - Assertion Type: `verified_email`
   - Credential Type: `bearer_token`
   - Claim URI: `https://syncogia.com/agent/claim`
   - Use Case: Agent registers with a user's verified email address; confirmation is handled out-of-band via magic link or claim code.

3. **Anonymous / Delegated Session**
   - Type: `anonymous`
   - Credential Type: `bearer_token`
   - Claim URI: `https://syncogia.com/agent/claim`
   - Use Case: Agent bootstraps a temporary guest or unauthenticated session, then provides the user with `claim_uri` to authorize full account access.

## 4. Credential Usage

All issued tokens are standard OAuth 2.0 Bearer tokens:
- **Header**: Send the access token in HTTP requests using the `Authorization` header:
  ```http
  Authorization: Bearer <access_token>
  ```
- **Scopes**: Available scopes include `openid`, `profile`, `email`.
- **Revocation**: Issued credentials can be revoked at any time via `https://syncogia.com/oauth/revoke`.
