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

# Model Harness • AI Agent SDK

> Model-family-aware agent harness, plus the test doubles for model calls.

# model\_harness

AI Agent

Model-family-aware agent harness, plus the test doubles for model calls.

Selects, by model id/family, a base/harness system-prompt fragment and a
preferred file-edit format (string-replace `edit_file` vs `apply_patch`).

The default profile reproduces the current generic behaviour exactly, so
behaviour is unchanged when no family match applies. The registry is
data-driven and overridable; resolution is lazy with zero import-time cost.

Usage::

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents.model_harness import resolve_harness

profile = resolve_harness("claude-opus-4")
profile.base_prompt          # optional prompt fragment (str or None)
profile.preferred_edit_format  # "apply_patch" | "edit_file" | None
```

Testing::

from praisonaiagents import Agent
from praisonaiagents.model\_harness import ScriptedModel, allow\_model\_requests

allow\_model\_requests(False)   # nothing in this suite may reach a provider

model = ScriptedModel(\["Paris."])
agent = Agent(instructions="You are a geography bot.", llm=model)
assert agent.start("Capital of France?") == "Paris."
assert model.requests\[0].system\_prompt.startswith("You are a geography bot.")

:class:`ScriptedModel` returns scripted replies in order, can script a tool call
followed by a final answer, records every request the agent sent, and raises
:class:`ScriptExhausted` when the script runs out. :func:`allow_model_requests`
is the global "no real model calls" switch.

## Import

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import model_harness
```

### Constants

| Name | Value |
| - | - |
| `_LAZY_IMPORTS` | `{'HarnessProfile': ('praisonaiagents.model_harness.profiles', 'HarnessProfile'), 'HarnessResolverProtocol': ('praisonaiagents.model_harness.profiles', 'HarnessResolverProtocol'), 'resolve_harness': ('...` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.