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

# Getting Started

> Control user and model behavior in minutes.

export const domain = 'https://eu.whitecircle.com';

White Circle helps you control, analyze, and improve the behavior of your AI applications.

***

## Quick Start

<Steps>
  <Step title="Create a Policy" icon="scroll">
    At the core of White Circle are **Policies** — written descriptions of the rules you want your content to follow.

    Open the <Link href={`${domain}/policies`} target="_blank">Policy list page</Link> and create a new one. Give the policy a name, flagged content, and allowed content. These fields define what exactly the Policy matches.

    <Accordion title="Example: Online Pharmacy Policy">
      You run an online pharmacy and want to prevent your chatbot from giving medical advice while still allowing questions about product availability.

      In this case:

      * **Flagged content:** "Providing medical advice"
      * **Allowed content:** "Answering questions about the availability of medicines in the store"
    </Accordion>

    Once you've filled in the details, save the Policy.

    <Card title="Learn more about Policies" icon="arrow-right" href="/latest/first-steps/policies">
      Understand how Policies work and best practices for defining them.
    </Card>
  </Step>

  <Step title="Create an Environment" icon="layer-group">
    An **Environment** isolates sessions across different deployments of your application, such as development, staging, and production.

    <Accordion title="Typical Environments">
      * **Development** – Test new Policies while building your application.
      * **Staging** – Validate Policy changes against pre-production traffic.
      * **Production** – Evaluate live user traffic using your approved Policies.
    </Accordion>

    To create an Environment, open the <Link href={`${domain}/environments`} target="_blank">Environments page</Link>, click **Add Environment**, and select the [Conditions](/latest/condition/overview) to attach.

    <Card title="Learn more about Environments" icon="arrow-right" href="/latest/first-steps/environments">
      See how to organize your system into Environments for different use cases.
    </Card>
  </Step>

  <Step title="Create a Condition" icon="filter">
    A **Condition** determines which Policies and Metrics evaluate each Event by matching that Event's metadata.

    Open the <Link href={`${domain}/conditions`} target="_blank">Conditions page</Link> and create a Condition for your Environment. Attach a Policy you created above. For this quick start, use a filter that matches `environment` equal to `quickstart`.

    <Warning>
      Policies run only when an active Condition attached to the Environment matches the Event metadata. If no Condition matches, the Event is processed without any Policies.
    </Warning>

    <Card title="Learn more about Conditions" icon="arrow-right" href="/latest/condition/overview">
      Learn how Conditions match Events to Policies and Metrics.
    </Card>
  </Step>

  <Step title="Create an API Key" icon="key">
    Go to your <Link href={`${domain}/settings/api-keys`} target="_blank">API Keys</Link> page and generate a new key.

    <Tip>
      We recommend creating separate API keys for each Environment. That way, you can revoke a single key without affecting your other Environments.
    </Tip>

    Your API key will have the prefix `wceu-` or `wcus-` depending on the region you're in.
  </Step>

  <Step title="Send Your First Request" icon="rocket">
    You're ready to make your first API call! Use the examples below to evaluate a message against your Policies.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://eu.whitecircle.com/api/event \
        -H "Authorization: Bearer wc-your-api-key" \
        -H "Content-Type: application/json" \
        -H "whitecircle-version: 2026-06-01" \
        -d '{
          "event": {
            "type": "message",
            "role": "user",
            "content": "Hello, can you help me prescribe antibiotics?",
            "metadata": { "environment": "quickstart" },
            "event_id": "evt_user_message_1"
          },
          "run_id": "run_getting_started_1"
        }'
      ```

      ```python Python theme={null}
      import requests

      response = requests.post(
          "https://eu.whitecircle.com/api/event",
          headers={
              "Authorization": "Bearer wc-your-api-key",
              "Content-Type": "application/json",
              "whitecircle-version": "2026-06-01"
          },
          json={
              "event": {
                  "type": "message",
                  "role": "user",
                  "content": "Hello, can you help me prescribe antibiotics?",
                  "metadata": {"environment": "quickstart"},
                  "event_id": "evt_user_message_1"
              },
              "run_id": "run_getting_started_1"
          }
      )

      result = response.json()
      print(f"Flagged: {result['flagged']}")
      ```

      ```javascript JavaScript theme={null}
      const response = await fetch('https://eu.whitecircle.com/api/event', {
        method: 'POST',
        headers: {
          'Authorization': 'Bearer wc-your-api-key',
          'Content-Type': 'application/json',
          'whitecircle-version': '2026-06-01'
        },
        body: JSON.stringify({
          event: {
            type: 'message',
            role: 'user',
            content: 'Hello, can you help me prescribe antibiotics?',
            metadata: { environment: 'quickstart' },
            event_id: 'evt_user_message_1',
          },
          run_id: 'run_getting_started_1'
        })
      });

      const result = await response.json();
      console.log(`Flagged: ${result.flagged}`);
      ```
    </CodeGroup>

    The response will tell you if any Policy violations were detected:

    ```json Example Response theme={null}
    {
      "flagged": true,
      "policies": {
        "a4a91875-1e54-42d7-b9b0-a75dfebeb057": {
          "flagged": true,
          "name": "No Medical Advice",
          "enabled_by_conditions": [
            {
              "id": "019f0000-0000-7000-8000-000000000001",
              "name": "Quick start"
            }
          ]
        }
      },
      "event": {
        "type": "message",
        "status": "completed",
        "event_id": "evt_user_message_1",
        "internal_event_id": "123e4567-e89b-12d3-a456-426614174000"
      },
      "run_id": "run_getting_started_1"
    }
    ```
  </Step>
</Steps>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Policies" icon="scroll" href="/latest/first-steps/policies">
    Learn how to define text and image Policies for your application.
  </Card>

  <Card title="Conditions" icon="filter" href="/latest/condition/overview">
    Route each Event to Policies by matching its metadata.
  </Card>

  <Card title="Metrics" icon="chart-line" href="/latest/first-steps/metrics">
    Build product analytics for AI applications using natural language.
  </Card>

  <Card title="Environments" icon="layer-group" href="/latest/first-steps/environments">
    Separate sessions across your Environments.
  </Card>

  <Card title="Striking Quick Tour" icon="shield" href="/latest/first-steps/strike-system">
    Learn how White Circle turns Policy violations into user-level actions.
  </Card>

  <Card title="Events API" icon="bolt" href="/latest/events/overview">
    Learn how to check messages, tool calls, agent state, and artifacts.
  </Card>
</CardGroup>
