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

# Quick Start

> Get AgentRein protecting your agent in under 5 minutes.

<Steps>
  <Step title="Install the SDK">
    <CodeGroup>
      ```bash TypeScript theme={null}
          npm install agentrein
      ```

      ```bash Python theme={null}
          pip install agentrein
      ```
    </CodeGroup>
  </Step>

  <Step title="Get Your API Key">
    Log in to [Dashboard](https://agentrein.com/dashboard), go to **Settings**, and copy your API key.
  </Step>

  <Step title="Initialize the Client">
    <CodeGroup>
      ```ts TypeScript theme={null}
          import { AgentRein } from 'agentrein';
          import { Octokit } from '@octokit/rest'; // Developer's own standard SDK

          const agentrein = new AgentRein({ apiKey: 'YOUR_API_KEY' });
          const octokit = new Octokit({ auth: 'GITHUB_TOKEN' });
      ```

      ```python Python theme={null}
          from agentrein import AgentRein
          from github import Github  # Developer's own standard SDK

          agentrein = AgentRein(api_key="YOUR_API_KEY")
          gh = Github("GITHUB_TOKEN")
          repo = gh.get_repo("my-org/my-repo")
      ```
    </CodeGroup>
  </Step>

  <Step title="Create a Session">
    <CodeGroup>
      ```ts TypeScript theme={null}
          const session = await agentrein.newSession({
            agentId: 'onboarding-agent',
            intent: 'Create a GitHub issue and notify the team on Slack',
          });
      ```

      ```python Python theme={null}
          session = agentrein.new_session(
              agent_id="onboarding-agent",
              intent="Create a GitHub issue and notify the team on Slack",
          )
      ```
    </CodeGroup>
  </Step>

  <Step title="Wrap Your Existing Clients">
    <CodeGroup>
      ```ts TypeScript theme={null}
          const agentOctokit = agentrein.wrap(octokit, session, { connector: 'github' });
          const agentSlack   = agentrein.wrap(slackClient, session, { connector: 'slack' });

          const issue = await agentOctokit.issues.create({
              owner: 'my-org',
              repo: 'my-repo',
              title: 'Onboarding task',
          });

          await agentSlack.chat.postMessage({
              channel: '#onboarding',
              text: `Issue created: ${issue.data.html_url}`,
          });
      ```

      ```python Python theme={null}
          agent_repo   = agentrein.wrap(repo, session, connector="github")
          agent_slack  = agentrein.wrap(slack_client, session, connector="slack")

          issue = agent_repo.create_issue(title="Onboarding task")

          agent_slack.chat_postMessage(
              channel="#onboarding",
              text=f"Issue created: {issue.html_url}",
          )
      ```
    </CodeGroup>

    <Info>
      The Python example wraps `repo` (the object returned by `gh.get_repo(...)`) directly rather than the top-level `gh` client — see [Connectors](/docs/sdk/connectors) for why this matters.
    </Info>
  </Step>

  <Step title="Complete the Session">
    <CodeGroup>
      ```ts TypeScript theme={null}
          await agentrein.completeSession(session);
      ```

      ```python Python theme={null}
          agentrein.complete_session(session)
      ```
    </CodeGroup>
  </Step>
</Steps>

## Plan Tiers & API Keys

AgentRein has four plan tiers: **FREE**, **PRO**, **TEAM**, and **ENTERPRISE**.

Your API key works across all plans, but certain features require a minimum plan:

| Feature | FREE | PRO | TEAM |
| - | - | - | - |
| Session Rollback | ✓ | ✓ | ✓ |
| API Key Management | ✓ | ✓ | ✓ |
| Connector Credentials | ✓ | ✓ | ✓ |
| Approval Gates (HITL) | ✗ | ✓ | ✓ |
| Intent Drift Detection | ✗ | ✗ | ✓ |

<Note>
  If you call a PRO or TEAM feature on a FREE plan, the backend returns a `403` with a clear error message. Upgrade at [Dashboard → Settings → Billing](https://agentrein.com/dashboard/settings/billing).
</Note>

To get your API key: **Dashboard → API Keys → Create New Key**.

***

## Testing & Sandbox

To test your agent without executing real actions, create a **Sandbox API key** in **Dashboard → Settings → API Keys**. Sandbox keys have the prefix `ar_test_` and simulate all connector calls — nothing is written to GitHub, Stripe, or Slack.

Switch between sandbox and production by changing one environment variable:

```env theme={null}
# Development
AGENTREIN_API_KEY=ar_test_your_key_here

# Production
AGENTREIN_API_KEY=ar_live_your_key_here
```

See [Sandbox Mode](/docs/sdk/installation#sandbox-mode) for full details.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.