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

# Quickstart

> Get quint-agent running in 2 minutes.

## 1. Install

```bash theme={null}
pip install quint-agent
```

## 2. Get an API key

Go to [cloud.quintai.dev/settings](https://cloud.quintai.dev/settings) and create an SDK API key. It starts with `qak_`.

## 3. Initialize

```python theme={null}
import quint_agent

quint_agent.init(api_key="qak_your_key_here")
```

Or set the environment variable:

```bash theme={null}
export QUINT_API_KEY=qak_your_key_here
```

```python theme={null}
import quint_agent
quint_agent.init()  # reads from QUINT_API_KEY
```

## 4. Guard your tools

```python theme={null}
@quint_agent.guard()
def read_file(path: str) -> str:
    return open(path).read()

@quint_agent.guard()
def run_command(cmd: str) -> str:
    import subprocess
    return subprocess.check_output(cmd, shell=True, text=True)

@quint_agent.guard()
def query_db(sql: str) -> list:
    return db.execute(sql).fetchall()
```

Every call is now:

* **Captured** — tool name, arguments, result, timing
* **Policy-checked** — blocked if it violates your security rules
* **Streamed** — async telemetry to Quint cloud (non-blocking)

## 5. See it in the dashboard

Open [cloud.quintai.dev](https://cloud.quintai.dev). Your agent's session appears in real-time with every tool call, policy decision, and behavioral signal.

## What happens when a tool is blocked

```python theme={null}
from quint_agent import ToolBlockedError

try:
    read_file(path="/home/user/.env")
except ToolBlockedError as e:
    print(f"Blocked: {e}")
    # Blocked: tool 'read_file' denied by rule 'deny-dotenv': argument 'path' matches '*.env'
```

The agent receives the error and can decide what to do — retry with different arguments, ask the user, or move on.

## Framework integrations

<Tabs>
  <Tab title="Anthropic">
    ```python theme={null}
    import anthropic
    import quint_agent
    from quint_agent.integrations.anthropic import guarded_dispatch

    quint_agent.init(api_key="qak_...")
    client = anthropic.Anthropic()

    tools_map = {"read_file": read_file, "run_command": run_command}
    response = client.messages.create(
        model="claude-sonnet-4-6",
        max_tokens=1024,
        tools=[...],
        messages=[{"role": "user", "content": "List the project files"}],
    )

    for block in response.content:
        if block.type == "tool_use":
            result = guarded_dispatch(block.name, block.input, tools_map)
    ```
  </Tab>

  <Tab title="LangChain">
    ```python theme={null}
    from quint_agent.integrations.langchain import QuintCallbackHandler

    quint_agent.init(api_key="qak_...")

    chain = create_tool_agent(llm, tools, prompt)
    chain.invoke(
        {"input": "What's in the project?"},
        config={"callbacks": [QuintCallbackHandler()]},
    )
    ```
  </Tab>

  <Tab title="MCP">
    ```python theme={null}
    from quint_agent.integrations.mcp import QuintMCPClient

    quint_agent.init(api_key="qak_...")

    async with mcp_client() as session:
        guarded = QuintMCPClient(session)
        result = await guarded.call_tool("read_file", {"path": "/x"})
    ```
  </Tab>
</Tabs>

## Next steps

<CardGroup cols={2}>
  <Card title="Policy DSL" icon="shield" href="/sdk/policy">
    Write YAML rules to control what your agents can do
  </Card>

  <Card title="API Reference" icon="book" href="/sdk/api-reference">
    Full reference for init(), guard(), and integrations
  </Card>
</CardGroup>
