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

# Getting Started

> Build, test, and publish an agent on TrueFoundry Agent Harness using the Playground — pick a model, attach MCP tools and skills, then save and share.

<Note>TrueFoundry Agent Harness is available on **SaaS** only.</Note>

Build agents natively on TrueFoundry. You bring the intent — TrueFoundry handles everything else.

<CardGroup cols={2}>
  <Card title="Bring Your Own Model" icon="brain">
    Connect any LLM available through TrueFoundry's AI Gateway. Switch models without rewriting your agent.
  </Card>

  <Card title="Skills" icon="book-open">
    Attach versioned `SKILL.md` instructions from the Skills Registry. The agent loads the right skill at runtime — no prompt bloat.
  </Card>

  <Card title="MCP Server Integration" icon="plug">
    Plug in any MCP server to give your agent tools — web search, APIs, databases, file access, and more.
  </Card>

  <Card title="Sandbox Access" icon="box">
    Agents run in a secure execution environment. Code execution, file operations, and external calls are sandboxed by default.
  </Card>
</CardGroup>

TrueFoundry manages the platform problems so you don't have to: context window management, tool call orchestration, conversation history, system prompt handling, and multi-turn state. You focus on building and shipping.

***

## Agent Playground

Navigate to **Agents > Playground** in the sidebar to open the Playground directly — no registry step required. The Playground is where you build, configure, and test your agent interactively.

<Frame caption="Agent Playground showing model selection, instructions, MCP servers, and skills">
  <img src="https://mintcdn.com/truefoundry/STdC6DXD8_zxYJJC/images/agent-playgroun-new.png?fit=max&auto=format&n=STdC6DXD8_zxYJJC&q=85&s=d8c01c44022f46749bc93b3eaadaf894" alt="Agent Playground with model selection, system prompt, MCP servers, and skills panels" width="3024" height="1710" data-path="images/agent-playgroun-new.png" />
</Frame>

<Steps>
  <Step title="Select a model">
    Choose any model available through AI Gateway.
  </Step>

  <Step title="Write your instructions">
    Add a system prompt that defines the agent's behavior, persona, and constraints.
  </Step>

  <Step title="Connect MCP Servers">
    Click the **+** next to **MCP Servers** to open the tool selection dialog. Search for MCP servers, browse available tools, and select the ones your agent needs.

    <Frame caption="Tools and MCP Servers selection dialog">
      <img src="https://mintcdn.com/truefoundry/Q_Txgy7BrCvpBj-e/images/agent_playground_mcp_server.png?fit=max&auto=format&n=Q_Txgy7BrCvpBj-e&q=85&s=bf26b6acf5f27006cec5848ae44086c6" alt="Tools and MCP Servers selection dialog" width="2662" height="1704" data-path="images/agent_playground_mcp_server.png" />
    </Frame>
  </Step>

  <Step title="Add Skills">
    Click the **+** next to **Skills** to open the Skills selector. It lists every skill you have access to, grouped by Repository. Each row has a version dropdown — defaults to the latest, but you can pin any older version.

    <Frame caption="Skills selector showing available skills with per-skill version dropdowns and the SKILL.md preload toggle">
      <img src="https://mintcdn.com/truefoundry/xnxwG9wbAPzCd_DD/images/skills_selector.png?fit=max&auto=format&n=xnxwG9wbAPzCd_DD&q=85&s=5d3308f2089f989ca4db50f83dffa3da" alt="Skills selector in the Agent Playground listing available skills with version pickers and a preload toggle" width="3600" height="1980" data-path="images/skills_selector.png" />
    </Frame>

    Check the skills you want. Each selected skill has a **Preload SKILL.md** toggle:

    | Mode              | Behavior                                                                                                                                  |
    | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
    | **Off (default)** | Only the skill's `name` and `description` are exposed upfront. The body is loaded on demand when the agent decides the skill is relevant. |
    | **On**            | The full `SKILL.md` body is injected upfront. Higher context cost, but no extra step at runtime.                                          |

    <Tip>
      Turn preload **on** for short, always-relevant skills. Leave it **off** for long, situational skills that only fire occasionally.
    </Tip>

    <Note>
      Two skills cannot share the same `name` within a single agent, even across different Repositories. The selector greys out conflicting skills and shows a tooltip — pick one or use a differently named copy.
    </Note>

    Skills require the agent's **Sandbox** to be enabled. Access is inherited from the skill's parent [Repository](/docs/platform/repositories) — end-users invoking a saved agent get implicit access to all skills attached at save time.
  </Step>

  <Step title="Run and iterate">
    Use the chat interface to test the agent. Adjust the prompt, switch models, or add more tools until the agent behaves as expected.
  </Step>
</Steps>

### Saving the Agent

Once you're satisfied with the agent's behavior, click **Save Agent** in the top-right corner. The dropdown gives you two options:

* **Save New Version** — Update an existing agent with your changes.
* **Save New Agent** — Create a brand-new agent from the current configuration.

<Frame caption="Save dropdown with Save New Version and Save New Agent options">
  <img src="https://mintcdn.com/truefoundry/Q_Txgy7BrCvpBj-e/images/agent_playground_save_agent.png?fit=max&auto=format&n=Q_Txgy7BrCvpBj-e&q=85&s=130496b685c54f92b55930e2009b55d8" alt="Save dropdown with Save New Version and Save New Agent options" width="684" height="368" data-path="images/agent_playground_save_agent.png" />
</Frame>

***

## Saved Agent

Once saved, your agent appears in the **Agent Registry**. Click the agent name to open its detail page.

<Frame caption="Agent Registry — click the agent name to open its detail page">
  <img src="https://mintcdn.com/truefoundry/STdC6DXD8_zxYJJC/images/click-on-agent.png?fit=max&auto=format&n=STdC6DXD8_zxYJJC&q=85&s=c0aa0c40e079e4d55ec6e733265c4c17" alt="Agent Registry showing a list of agents with the ask-ai-agent row highlighted" width="2694" height="952" data-path="images/click-on-agent.png" />
</Frame>

The detail page has three tabs: **Overview**, **Agent Runs**, and **Use in Code**.

### Overview

The Overview tab shows the full agent configuration at a glance — model, model parameters, execution settings (sandbox, iteration limit, response format), system instructions, connected MCP tools, and attached skills.

<Frame caption="Agent detail page — Overview tab showing model, instructions, connected tools, and attached skills">
  <img src="https://mintcdn.com/truefoundry/STdC6DXD8_zxYJJC/images/saved-agent-overview.png?fit=max&auto=format&n=STdC6DXD8_zxYJJC&q=85&s=f638f36b8b331cddd896d27ad430b3a3" alt="Agent Overview tab showing model config, instructions, connected tools and attached skills" width="2516" height="1674" data-path="images/saved-agent-overview.png" />
</Frame>

Click **Test Agent** to reopen the agent in the Playground for further iteration. To edit the agent's name, description, tags, or collaborator permissions, click **Manage** from the registry row.

### Agent Runs

The **Agent Runs** tab gives you a single place to see every execution of this specific agent. Unlike the global AI Monitoring view, this is scoped to the agent — so you can understand exactly how it is being used and by whom.

<Frame caption="Agent Runs tab showing a filterable list of executions with turn count and cost per run">
  <img src="https://mintcdn.com/truefoundry/STdC6DXD8_zxYJJC/images/agent-run-view.png?fit=max&auto=format&n=STdC6DXD8_zxYJJC&q=85&s=daf1a4734246643f26a8ab1fd9beb285" alt="Agent Runs tab with a list of executions filtered by last 30 days, showing user, message, turns, and cost" width="2464" height="1686" data-path="images/agent-run-view.png" />
</Frame>

From this view you can:

* **See who is using the agent** — each run shows the user or virtual account that invoked it.
* **Filter runs** — narrow down by time range, user email, or any custom metadata passed at invocation time.
* **Gauge cost and complexity** — turn count and dollar cost are visible per run without opening anything.

Click any row to drill into that run. The detail panel shows the full conversation — every user message and assistant response in sequence — along with total turns, cost, and token usage at the top.

<Frame caption="Single run detail showing the full conversation, turn count, cost, and token usage">
  <img src="https://mintcdn.com/truefoundry/STdC6DXD8_zxYJJC/images/agent-run-single-run-view.png?fit=max&auto=format&n=STdC6DXD8_zxYJJC&q=85&s=e783ffaf83c8a87782e2815481410141" alt="Single agent run detail showing user message, assistant response, turn count, cost, and token usage" width="2584" height="1692" data-path="images/agent-run-single-run-view.png" />
</Frame>

Each assistant turn has a **View turn trace** link that opens the corresponding span in AI Monitoring, so you can debug tool calls, reasoning steps, or latency issues without leaving the context of the run.

### Use in Code

If you want to integrate this agent into your application or automate it from a pipeline, the **Use in Code** tab has ready-to-copy Python and TypeScript snippets generated for this specific agent.

<Frame caption="Use in Code tab with auto-generated Python and TypeScript snippets">
  <img src="https://mintcdn.com/truefoundry/STdC6DXD8_zxYJJC/images/agent-code-snippet.png?fit=max&auto=format&n=STdC6DXD8_zxYJJC&q=85&s=64b73652328cebfa3d0c602ab877941f" alt="Use in Code tab showing a Python code snippet using the truefoundry gateway SDK" width="2486" height="1702" data-path="images/agent-code-snippet.png" />
</Frame>

For the full SDK guide, authentication setup, and streaming tutorial, see [Create and use agents via SDK](/docs/agent-platform/agent-harness/sdk/overview).
