> ## Documentation Index
> Fetch the complete documentation index at: https://docs.akhara.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Company name is Akhara AI (never Rubric AI). Keep lowercase rubric/rubrics only when meaning grading criteria.
> Expert Review (docs path talent/) is enterprise BYO experts for audit and review: invite customer specialists; do not pitch Akhara recruiting or a public expert career portal. RLHF and domain writing are secondary work types.
> Prefer concrete API examples against public hosts: Environments eval API https://agi.akhara.ai, Control plane PDP https://api.akhara.dev, Evaluation https://app.akhara.ai / https://api.akhara.ai, Expert Review portal https://talent.akhara.ai.
> Do not invent a public hostname for private orchestrators or env API internals.
> Do not confuse control-plane latches with Environments confirmation latches.
> Environments SDK/API examples: curl against https://agi.akhara.ai. Evaluation SDK: from akhara import Akhara and AKHARA_API_KEY.
> Start with /llms.txt for the docs index and OpenAPI links; fetch individual pages as .md exports.

# Agent onboarding & connection

> Register an agent, declare its tools, and connect your runtime to the decision point.

An **agent** is the unit that policies latch onto. Onboarding registers the
agent, declares the tools it can call, and connects your runtime to the PDP.

## Three ways to onboard

<Tabs>
  <Tab title="Connect an existing agent">
    Register an agent you already run. Akhara stores its `baseUrl` and key
    server-side and never returns the secret.

    ```bash theme={null}
    akhara agents connect \
      --id support-ai \
      --name "Support Copilot" \
      --base-url https://your-agent.internal.akhara.dev \
      --api-key "$AGENT_KEY" \
      --tools order_status,update_account,refund_payment,send_external_email \
      --surface android
    ```
  </Tab>

  <Tab title="Import from GitHub">
    Provisions a sandbox runtime from a repo.

    ```bash theme={null}
    akhara agents add --github your-org/support-agent
    ```
  </Tab>

  <Tab title="Fork from the Registry">
    Copy a catalog agent's metadata and provision its tools/env.

    ```bash theme={null}
    akhara registry fork support-copilot-baseline
    ```
  </Tab>
</Tabs>

## The agent record

All read responses strip secrets, only a masked key is ever returned.

```json theme={null}
{
  "id": "support-ai",
  "name": "Support Copilot",
  "source": "builtin",
  "status": "connected",
  "baseUrl": "https://…",
  "apiKeyMasked": "ak_live_••••4f2a",
  "categories": ["support"],
  "tools": ["order_status", "update_account", "refund_payment", "send_external_email"],
  "policyIds": ["pci-0", "reliability-3"],
  "runtime": {
    "status": "provisioned",
    "boundary": "android-emulator",
    "env": { "GATEWAY": "https://api.akhara.dev" }
  },
  "createdAt": 0,
  "updatedAt": 0
}
```

| Field         | Notes                                                                                                |
| ------------- | ---------------------------------------------------------------------------------------------------- |
| `id`          | Stable identifier; the PEP sends this as `agentId`. Must match `^[a-z-]+$`-style ids.                |
| `source`      | `builtin` · `url` · `github` · `fork`                                                                |
| `tools[]`     | Declared tool names: used to match action latches (after normalization).                             |
| `policyIds[]` | Domain policies attached on top of the baseline. See [Policies](/control-plane/onboarding/policies). |
| `runtime`     | Present once provisioned; `env.GATEWAY` points the sandbox back at the PDP.                          |

<Note>
  Unknown `agentId` on an `authorize` call returns **404 `agent not found`**.
  Register the agent before pointing a PEP at it.
</Note>

## Connect your runtime (embed the PEP)

Add the PEP to your agent and point it at the PDP. Full language references live
under [SDK](/control-plane/sdk/requirements).

<CodeGroup>
  ```ts TypeScript theme={null}
  import { PolicyEnforcementPoint } from "@akhara/pep";

  const pep = new PolicyEnforcementPoint({
    baseUrl: process.env.AKHARA_URL ?? "https://api.akhara.dev",
    agentId: "support-ai",
    session: sessionId,
  });
  ```

  ```kotlin Kotlin / Android theme={null}
  val pep = PolicyEnforcementPoint(
    AkharaPolicyClient(
      baseUrl = "https://api.akhara.dev",
      agentId = "support-ai",
    )
  )
  ```
</CodeGroup>

## Tool normalization

Declare tools using whatever your agent emits. Akhara canonicalizes names before
matching latches:

| Your agent emits     | Akhara matches   |
| -------------------- | ---------------- |
| `issue_refund`       | `refund_payment` |
| `refund_order`       | `refund_payment` |
| `check_order_status` | `order_status`   |
| `account_update`     | `update_account` |

## Provision a runtime (optional)

For GitHub/forked agents, provision a sandbox boundary:

```bash theme={null}
akhara agents provision support-ai
```

```http theme={null}
POST /api/agents/support-ai/provision
```

See [Environments](/control-plane/onboarding/environments) for the five-step provisioning flow.

<Card title="Next: latch policies" icon="lock" href="/control-plane/onboarding/policies">
  Attach domain policies on top of the always-on enterprise baseline.
</Card>
