> ## 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.

# Agent Harness: 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 two tabs: **Overview** and **Agent Sessions**.

### Overview

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

<Frame caption="Agent detail page — Overview tab showing model, instructions, connected MCP servers, skills, model parameters, and execution settings">
  <img src="https://mintcdn.com/truefoundry/NBBsOgyQxZXJihpe/images/agent-sessions-overview.png?fit=max&auto=format&n=NBBsOgyQxZXJihpe&q=85&s=d826a377cd670ad6c183d86a84499dee" alt="Agent Overview tab showing model config, instructions, connected MCP servers, attached skills, model parameters, and execution settings" width="1024" height="583" data-path="images/agent-sessions-overview.png" />
</Frame>

Click **Test Agent** to reopen the agent in the Playground for further iteration. Click **Edit** to change the agent's configuration.

### Agent Sessions

The **Agent Sessions** tab gives you a single place to see every session of this specific agent — scoped to the agent, so you can understand exactly how it is being used and by whom. Each row shows the creator, cost, turns, and duration; click a row to open the full session detail with per-turn metrics and traces.

For the full walkthrough of the sessions list, session metrics, the event-type timeline, and traces — including the global cross-agent view — see [Observability](/docs/agent-platform/agent-harness/observability).

### 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).
