# Trustlith Developer Center (`llms.txt`)

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

## Current Capability Scope
- **LIVE (Public Runtime API v1):** Passwordless `login` step-up and `fund_transfer` transaction authorization (`TRUSTLITH-AUTH-V1\0`, ES256 P-256).
- **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
- Proposed public Developer Center distribution: `https://developers.trustlith.com`
- `TRUSTLITH-INTEGRATION.md` ([GitHub source](./TRUSTLITH-INTEGRATION.md)): Self-contained backend integration bundle (auth, `login`, `fund_transfer`, polling, cancel, error matrix, and AI coding guardrails).
- `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): Dual-path manual + AI integration hub.
- [5-Step Quickstart](./docs/developer-center/quickstart.md): End-to-end Portal setup -> API key -> test user -> QR enrollment -> challenge flow.
- [API Reference](./docs/developer-center/api-reference.md): Verified V1 routes, Bearer scopes, origin matching, and status transitions.
- [Code Examples](./docs/developer-center/examples.md): Node.js (TypeScript/Fetch), Python, and cURL examples.
- [User Enrollment Guide](./docs/developer-center/user-enrollment.md): Mapping users, issuing QR handoffs (`/v1/enrollments` + `/v1/enrollment-handoffs`), and device completion.
- [AI Coding Agent Guide](./docs/developer-center/ai-agent-guide.md): Prompting and security guardrails for autonomous coding agents.
- [Developer Changelog](./docs/developer-center/changelog.md): Live V1 milestones separated from planned V2 roadmap.

## Non-Negotiable Integration Rules
1. Keep `TRUSTLITH_API_KEY` exclusively server-side; never bundle into browser/mobile code.
2. Never send `tenantId` or `applicationId` in `POST /v1/challenges` payloads (`400 SCOPE_NOT_ACCEPTED`).
3. Always match `context.origin` exactly against the registered application origin.
4. For `fund_transfer`, always include `transactionContext.type = "fund_transfer"`.
5. Fail closed: authorize sensitive actions only when server-side `GET /v1/challenges/:challengeId/status` confirms `status === "APPROVED"`.
