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

# Quickstart: Instrument Your First AI Agent with Trident

> Install the Trident SDK, initialize it with your project keys, and see your first security traces in the dashboard in under 5 minutes.

This guide walks you through installing the Trident SDK, initializing it with your project keys, and making your first traced LLM call. By the end you'll see live traces appearing in your Trident dashboard and be ready to run your first security scan.

## Prerequisites

* A Trident account at [app.usetrident.dev](https://app.usetrident.dev)
* Node.js 18+ (TypeScript) or Python 3.9+ (Python)
* An OpenAI API key (used in the example below — any supported provider works)

## Steps

<Steps>
  ### Create a project and copy your API keys

  After signing in to [app.usetrident.dev](https://app.usetrident.dev), create a new project from the dashboard home page. Then open **Settings** for your project and copy two values:

  * **Project Public Key** — starts with `pk-lf-`
  * **Project Secret Key** — starts with `sk-lf-`

  You'll use both keys to authenticate the SDK. Keep your secret key out of source control.

  ### Install the SDK

  <Tabs>
    <Tab title="TypeScript">
      <CodeGroup>
        ```bash npm theme={null}
        npm install @vouch-ai/sdk
        ```

        ```bash yarn theme={null}
        yarn add @vouch-ai/sdk
        ```

        ```bash pnpm theme={null}
        pnpm add @vouch-ai/sdk
        ```
      </CodeGroup>
    </Tab>

    <Tab title="Python">
      ```bash pip theme={null}
      pip install vouch-sdk
      ```
    </Tab>
  </Tabs>

  ### Initialize the SDK

  Call `init()` once at application startup — before any LLM call is made. The SDK reads your project keys and wires up automatic OpenTelemetry instrumentation for every LLM client in the process.

  <Tabs>
    <Tab title="TypeScript">
      ```typescript theme={null}
      import { trident } from "@vouch-ai/sdk";

      trident.init({
        projectPk: process.env.TRIDENT_PROJECT_PUBLIC_KEY,
        projectSk: process.env.TRIDENT_PROJECT_SECRET_KEY,
        agentId: "my-first-agent", // optional — scopes traces to this agent in the dashboard
      });
      ```

      Store your keys in a `.env` file:

      ```bash .env theme={null}
      TRIDENT_PROJECT_PUBLIC_KEY=pk-lf-...
      TRIDENT_PROJECT_SECRET_KEY=sk-lf-...
      ```
    </Tab>

    <Tab title="Python">
      ```python theme={null}
      import vouch_sdk

      vouch_sdk.init(
          project_pk=os.environ["TRIDENT_PROJECT_PUBLIC_KEY"],
          project_sk=os.environ["TRIDENT_PROJECT_SECRET_KEY"],
          agent_id="my-first-agent",       # optional — scopes traces to this agent
      )
      ```

      Store your keys in a `.env` file (loaded with a library such as `python-dotenv`):

      ```bash .env theme={null}
      TRIDENT_PROJECT_PUBLIC_KEY=pk-lf-...
      TRIDENT_PROJECT_SECRET_KEY=sk-lf-...
      ```

      Alternatively, pass the keys as `project_pk` / `project_sk` keyword arguments directly. You can also omit both arguments entirely and set the environment variables — the SDK reads them automatically.
    </Tab>
  </Tabs>

  <Note>
    Both `TRIDENT_PROJECT_PUBLIC_KEY` / `TRIDENT_PROJECT_SECRET_KEY` and the legacy
    `VOUCH_PROJECT_PUBLIC_KEY` / `VOUCH_PROJECT_SECRET_KEY` environment variable names
    are supported. The `TRIDENT_*` names take priority if both are set.
  </Note>

  ### Make a traced LLM call

  After `init()` runs, every LLM call in the same process is automatically captured as an OpenTelemetry trace — no code changes to your model calls required.

  <Tabs>
    <Tab title="TypeScript">
      ```typescript theme={null}
      import { trident } from "@vouch-ai/sdk";
      import OpenAI from "openai";

      trident.init({
        projectPk: process.env.TRIDENT_PROJECT_PUBLIC_KEY,
        projectSk: process.env.TRIDENT_PROJECT_SECRET_KEY,
        agentId: "my-first-agent",
      });

      const openai = new OpenAI(); // uses OPENAI_API_KEY from env

      const response = await openai.chat.completions.create({
        model: "gpt-4o-mini",
        messages: [
          { role: "system", content: "You are a helpful assistant." },
          { role: "user", content: "What is the capital of France?" },
        ],
      });

      console.log(response.choices[0].message.content);
      // This call is now traced in your Trident dashboard.
      ```
    </Tab>

    <Tab title="Python">
      ```python theme={null}
      import os
      import vouch_sdk
      from openai import OpenAI

      vouch_sdk.init(
          project_pk=os.environ["TRIDENT_PROJECT_PUBLIC_KEY"],
          project_sk=os.environ["TRIDENT_PROJECT_SECRET_KEY"],
          agent_id="my-first-agent",
      )

      client = OpenAI()  # uses OPENAI_API_KEY from env

      response = client.chat.completions.create(
          model="gpt-4o-mini",
          messages=[
              {"role": "system", "content": "You are a helpful assistant."},
              {"role": "user", "content": "What is the capital of France?"},
          ],
      )

      print(response.choices[0].message.content)
      # This call is now traced in your Trident dashboard.
      ```
    </Tab>
  </Tabs>

  <Tip>
    For TypeScript apps, you can enable zero-code auto-instrumentation without
    modifying your source at all. Pass `@vouch-ai/sdk/register` as a Node.js
    require flag and set your keys in the environment:

    ```bash theme={null}
    TRIDENT_PROJECT_PUBLIC_KEY=pk-lf-... \
    TRIDENT_PROJECT_SECRET_KEY=sk-lf-... \
    node --require @vouch-ai/sdk/register your-app.js
    ```

    You can also set this permanently via `NODE_OPTIONS`:

    ```bash .env theme={null}
    NODE_OPTIONS=--require @vouch-ai/sdk/register
    ```
  </Tip>

  ### View your traces in the dashboard

  Navigate to your project in [app.usetrident.dev](https://app.usetrident.dev) and open the **Traces** page from the sidebar. You'll see:

  * A new trace row for each LLM call, with the model name, latency, and token counts
  * The full prompt and completion text for each span
  * An agent-level view if you passed `agentId` to `init()`

  The dashboard also automatically runs Trident's **Monitor** — a background scanner that sweeps your traces every \~45 seconds for tool-failure patterns, silent errors, and anomalous behavior. Any issues surface as findings in the **Findings** inbox.
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Run a Red-Team Campaign" icon="crosshairs" href="/agents/red-teaming">
    Launch your first automated attack campaign against your agent using 200+ adversarial attack vectors.
  </Card>

  <Card title="Enable the Firewall" icon="shield-halved" href="/agents/firewall">
    Route your agent through the Trident firewall gateway to scan prompts and outputs in real time.
  </Card>

  <Card title="Explore Core Concepts" icon="book-open" href="/core-concepts">
    Understand projects, traces, findings, red-team runs, and the cloud security graph.
  </Card>

  <Card title="SDK Reference" icon="code" href="/sdk/typescript/installation">
    Explore the full TypeScript and Python SDK API, including `selfReport()` and `scan()`.
  </Card>
</CardGroup>
