# Trustlith Developer Center (`llms.txt`)

> Cryptographic authentication and high-trust transaction authorization built on Cloudflare Workers & D1.

## Current Capability Scope & V1 Constraints
- **LIVE (Public Runtime API v1):** Passwordless `login` step-up, `fund_transfer` transaction authorization (`TRUSTLITH-AUTH-V1\0`, ES256 P-256), challenge polling/cancel, and programmatic QR enrollment handoffs (`POST /v1/enrollments` + `POST /v1/enrollment-handoffs`).
- **V1 USER MAPPING REQUIREMENT:** V1 currently requires **manually mapped DEV users** in **Developer Portal → Users** (`externalUserId`). Automatic end-user provisioning (`POST /v1/users`) and self-service end-user device/recovery Application Bearer endpoints are **not yet supported** on public V1 API keys.
- **PROPOSED / NOT YET DEPLOYED (ADR 0022 V2):** Developer-defined Custom Auditable Transactions (`action: "custom"`, `/consume`, `/acknowledge-execution`) are specification-only and **not available on the live Runtime API**.
- **SDK Note:** `@trustlith/sdk-js` is a non-production local Phase 1 prototype. Integrate over standard backend HTTPS using `Authorization: Bearer <TRUSTLITH_API_KEY>`.

## Canonical Machine-Readable & Downloadable Docs
- Public Developer Center: `https://developers.trustlith.com`
- `TRUSTLITH-INTEGRATION.md` ([GitHub source](./TRUSTLITH-INTEGRATION.md)): Self-contained integration guide covering the full 10-step journey (developer setup, connectivity check, Account Settings → Security UI, QR enrollment, `action: "login"` confirmation, `optional`/`designated`/`required` policy modes, fail-closed active enforcement, and session-bound anti-bypass).
- `llms-full.txt`: Complete single-file generated corpus combining `llms.txt`, `TRUSTLITH-INTEGRATION.md`, all Developer Center guides, changelog, and `docs/openapi.yaml`.
- [OpenAPI 3.1 Specification](./docs/openapi.yaml): Exact V1 Runtime REST contracts, schemas, scopes, and error codes.
- [Developer Center Index](./docs/developer-center/README.md): Developer config vs end-user onboarding architecture hub.
- [10-Step Integration Journey](./docs/developer-center/quickstart.md): Ordered rollout preventing premature global lockout.
- [User Enrollment, Confirmation & Recovery](./docs/developer-center/user-enrollment.md): Manual V1 user mapping, QR handoffs, cryptographic confirmation, and V1 vs planned device recovery.
- [API Reference](./docs/developer-center/api-reference.md): Verified V1 routes, Portal key scopes, origin matching, and status transitions.
- [Code Examples & Reference UI](./docs/developer-center/examples.md): Backend connectivity, QR enrollment, Reference Account Settings → Security React UI, policy middleware, and session-bound anti-bypass handlers.
- [AI Coding Agent Guide](./docs/developer-center/ai-agent-guide.md): Guardrailed prompts and verification checklist for coding agents.
- [Developer Changelog](./docs/developer-center/changelog.md): Live V1 milestones separated from planned features.

## Non-Negotiable Integration Rules
1. Keep `TRUSTLITH_API_KEY` and `enrollmentToken` exclusively server-side; never bundle into browser/mobile code.
2. Never turn on global mandatory Trustlith enforcement before verifying Runtime availability (`GET /health` — availability only, does not validate keys), credential/mapping validity, Account Settings → Security QR enrollment, and test authentication.
3. Once mandatory authentication is active, **fail closed** on every non-`APPROVED` status (`PENDING`, `REJECTED`, `CANCELLED`, `EXPIRED`) and API failure.
4. Never send `tenantId` or `applicationId` in `POST /v1/challenges` payloads (`400 SCOPE_NOT_ACCEPTED`), and always exact-match `context.origin`.
5. Bind `challengeId` to the server session + immutable action context and enforce single-use consumption (`consumedAt`) inside your **customer backend/database** (V1 Runtime `/status` does not consume challenges; V2 Runtime `/consume` is planned, not deployed).
