# Get Started With AI Harness

Create a typed harness, register models and tools, and compose the first agent.

---
Canonical: /harness/get-started/
Source: web/src/data/harness-markdown.ts
Format: Markdown for agents
---

A harness starts from explicit runtime definitions. Keep the first version small: one model, one or two tools, and one agent with a clear business purpose.

```typescript
import { defineHarness, openai } from '@purista/harness'

const harness = defineHarness({ name: 'support' })
  .models({
    fast: {
      provider: openai({ apiKey }),
      model: 'gpt-4o-mini',
      capabilities: ['object'],
    },
  })
  .tools({
    searchDocs: {
      description: 'Search approved internal documentation.',
      input: z.object({ query: z.string() }),
      output: z.object({ results: z.array(z.string()) }),
      run: async ({ query }) => searchDocs(query),
    },
  })
  .agents({
    supportAgent: {
      model: 'fast',
      tools: ['searchDocs'],
      instructions: 'Answer only from approved documentation.',
    },
  })
```

Prefer a narrow first agent over a generic assistant. The harness should make the allowed behavior obvious in code review.
