# OpenAI Agents

URL: https://tailrace.dev/docs/integrations/openai-agents

> Wrap OpenAI Agents SDK function tools with Tailrace policy at the tool boundary.



Govern `@openai/agents` function tools so args and results pass through Tailrace.

## Quickstart [#quickstart]

```ts
import { createTailrace } from "@tailrace/core";
import { wrapTools } from "@tailrace/openai-agents";
import { Agent, tool } from "@openai/agents";
import { z } from "zod";

const crm = tool({
  name: "crm",
  description: "Lookup customer",
  parameters: z.object({ email: z.string() }),
  execute: async ({ email }) => ({ email }),
});

const tools = wrapTools(createTailrace(), [crm], { agent: "support" });
const agent = new Agent({ name: "Support", tools });
```

Peer: `@openai/agents` `>=0.3`.

## Boundaries covered [#boundaries-covered]

| Location                   | Tailrace boundary                          |
| -------------------------- | ------------------------------------------ |
| Tool args (`invoke` input) | `{ kind: "tool", name, direction: "out" }` |
| Tool result                | `{ kind: "tool", name, direction: "in" }`  |

Hosted tools (web search, file search, etc.) are out of scope.

## Guides [#guides]

* [OpenAI Agents integration](/docs/guides/openai-agents-integration)
* [Boundaries](/docs/concepts/boundaries)

## Reference [#reference]

* [openai-agents package](/docs/reference/openai-agents)
