# HarnessRouter Integration Docs

> Quick start for adding HarnessRouter to a product with a coding agent.

Canonical URL: https://harnessrouter.ai/docs
Agent copy target: https://harnessrouter.ai/agents.md

Use this page as a concise quick-start summary. To implement HarnessRouter in a product, copy the complete AGENTS.md instructions from https://harnessrouter.ai/agents.md into Codex, Claude Code, or another coding agent.

## Quick start

### 1. Paste AGENTS.md into your coding agent

Copy the official instructions and paste them into Codex, Claude Code, or another coding agent.

### 2. Ask it to build

Describe the product or feature you want. The coding agent will build the product interface and connect your backend to server-side agents through HarnessRouter.

### 3. Add your API key securely

When the coding agent opens a secure secret modal, create a Workspace API key and paste it into that modal. The agent stores it as HR_API_KEY and continues the build.

## Security Note

Paste the key only into the secure modal opened by your coding agent. Never paste it into normal chat, source files, AGENTS.md, browser code, logs, or screenshots.

## Key Resources

- [AGENTS.md](https://harnessrouter.ai/agents.md): Canonical implementation instructions.
- [Harness catalog](https://harnessrouter.ai/harnesses.md): Harness IDs, status, and source-backed references.
- [Guides](https://harnessrouter.ai/guides): Architecture and integration guides.

## Human Docs Directory

- [Product vs runtime agent](https://harnessrouter.ai/docs/host-app-vs-runtime-agent): Your product keeps the user experience, auth, data, permissions, and workflow. At runtime, it sends HarnessRouter one authorized end-user task.
- [Workspace](https://harnessrouter.ai/docs/workspace): Workspace API keys, configured agents, sessions, and returned files all live inside the Workspace that serves your product.
- [Configured agent / harness](https://harnessrouter.ai/docs/configured-agent-harness): It combines a base harness, model policy, instructions, tools, skills, and permissions. Your server calls it with the `harness_id` path segment.
- [Session and response](https://harnessrouter.ai/docs/session-and-response): Save the response ID and session ID from the stream. Your product needs both to recover, continue, cancel, and fetch artifacts.
- [Files and artifacts](https://harnessrouter.ai/docs/files-and-artifacts): Fetch generated files from your server, check product ownership, then preview or download them inside your product UI.
- [Authentication](https://harnessrouter.ai/docs/authentication): The browser should never call HarnessRouter directly with the Workspace API key.
- [Base URL](https://harnessrouter.ai/docs/base-url): Build all runtime and management requests against the HarnessRouter API host.
- [Harnesses](https://harnessrouter.ai/docs/harnesses-api): Use harness management endpoints from trusted server code or an authorized admin surface.
- [Models](https://harnessrouter.ai/docs/models): Ask the API for current models and for the models allowed by a configured agent. Treat the choice as part of your product evidence loop.
- [Run a task](https://harnessrouter.ai/docs/run-a-task): Use the configured agent ID as the first path segment. Prefer streaming when users need visible progress.
- [Streaming events](https://harnessrouter.ai/docs/streaming-events): HarnessRouter streams Server-Sent Events in an OpenAI Responses-style wire format with `data:` frames only.
- [Continue a session](https://harnessrouter.ai/docs/continue-a-session): Use continuation for revise, follow-up, incomplete work, or reconnecting to a task context.
- [Upload files](https://harnessrouter.ai/docs/upload-files): Use file upload for documents, data, source bundles, and other user-authorized inputs.
- [Sessions and files](https://harnessrouter.ai/docs/sessions-and-files): Use session endpoints after saving `response.metadata.session_id` from the stream.
- [Cancel a session](https://harnessrouter.ai/docs/cancel-a-session): Closing an SSE connection does not stop the server-side agent. Use cancel when the user intentionally stops work.
- [Errors and idempotency](https://harnessrouter.ai/docs/errors-and-idempotency): Every initial runtime request should include an idempotency key. Reuse it only when retrying the exact same request.
- [Server-side proxy pattern](https://harnessrouter.ai/docs/server-side-proxy-pattern): Your backend validates the product user, maps the feature to a configured agent, calls HarnessRouter, and returns a product-shaped result.
- [Feature key to harness mapping](https://harnessrouter.ai/docs/feature-key-to-harness-mapping): The browser should name the product action. The server should choose the configured agent.
- [Streaming UI](https://harnessrouter.ai/docs/streaming-ui): Your UI should show task progress, save recovery identifiers, and tolerate new stream event types without breaking.
- [File preview and download](https://harnessrouter.ai/docs/file-preview-and-download): Generated artifacts are product data. Your server should authorize every preview and download before relaying bytes.
- [Continue / revise](https://harnessrouter.ai/docs/continue-revise): Continue and revise should feel like one product task evolving, not a new unrelated run.
- [Multi-tenant authorization](https://harnessrouter.ai/docs/multi-tenant-authorization): HarnessRouter returns opaque session and file IDs. Your server decides which product user or tenant may continue, cancel, preview, or download them.
- [Choosing a harness](https://harnessrouter.ai/docs/choosing-a-harness): Run representative tasks through your real product path. Choose from dashboard Trace, stream behavior, recovery, files, artifacts, cost, and quality.
- [Tracing and optimization](https://harnessrouter.ai/docs/tracing-and-optimization): Use the dashboard control plane and your saved product records before changing instructions, model policy, tools, permissions, or runtime limits.
- [Production checklist](https://harnessrouter.ai/docs/production-checklist): Use this as a short release checklist for products that call HarnessRouter.
- [LLM resources](https://harnessrouter.ai/docs/llm-resources): Use these resources when an AI coding agent, search crawler, or documentation tool needs compact HarnessRouter context.
