# The Model Isn't Dangerous. Your Harness Is.

%[https://www.youtube.com/watch?v=VKPZjNPkf7o]

![](https://substackcdn.com/image/fetch/$s_!Pqve!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98542297-35e4-4d80-9441-a4e2c345fc1d_2232x866.png)

A developer agent burned **$12,000 in cloud costs overnight**.

A coding agent deleted a startup’s **entire production database—including backups—in nine seconds.**

Another AI agent executed a stale terraform destroy command and wiped **two and a half years of production data.**

None of these failures were caused by hackers. None were caused by a “bad” LLM.

They happened because the agent had **too much permission and too little supervision.**

The real risk isn’t the model.

It’s the **harness** around it.

---

### A Tool Is Much More Than Code

Most people think of a tool as a Python function.

![](https://substackcdn.com/image/fetch/$s_!jXI3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff07171aa-a6cd-4924-af8b-f2d3d14c1b9d_2232x972.png)

That’s implementationoduction systems care far more about the metadata around the tool.

Every tool should answer questions like:

- What is your name?
- What do you do?
- What inputs do you expect?
- What permissions do you require?
- Can you be retried?
- Can you be cached?
- How expensive are you?
- What happens if you fail?
- Should a human approve execution?

The actual business logic is often the smallest part.

Everything around it exists so the harness can use the tool **safely.**

---

### Every Tool Needs a Lifecycle

![](https://substackcdn.com/image/fetch/$s_!h0pj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a62c20d-9f25-49ff-965e-47330f89414f_2232x467.png)

Production systems shouldn’t invoke tools directly.

Instead, every tool should move through a lifecycle:

1. **Register** – Add the tool to the harness.
2. **Advertise** – Tell the LLM the tool exists.
3. **Select** – Let the model choose the tool.
4. **Validate** – Verify arguments and environment.
5. **Permission Check** – Confirm the user and agent are allowed to execute it.
6. **Execute** – Perform the action.
7. **Observe** – Capture success, failure, timeout, or partial completion.
8. **Normalize** – Convert outputs into a consistent format.
9. **Return to the Loop** – Feed results back to the reasoning engine.

Notice something interesting.

**Only one stage actually touches the real world: Execute.**

Everything else is architecture designed to prevent mistakes before they happen.

---

### Guardrails Don’t Sit Outside the Lifecycle

![](https://substackcdn.com/image/fetch/$s_!lIFB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8cb3a19-74ab-4c19-a2e5-3c0cb55f4b04_1488x801.png)

Many people imagine guardrails as a separate security layer.

They’re not.

Guardrails belong **inside** the tool lifecycle.

Different stages require different protections:

- **Registration** → Should this tool even be exposed?
- **Selection** → Is this the right tool for this request?
- **Permissions** → Should this user execute it?
- **Execution** → Does it require sandboxing, rate limits, or human approval?
- **Response** → Does the output contain secrets, PII, or unsafe content?

Good harnesses don’t rely on a single guardrail.

They place the **right guardrail at the right stage.**

---

### Principles of Good Tool Design

Over time, a few patterns consistently emerge:

- One tool should do one job well.
- Write descriptions for the model, not humans.
- Use structured JSON inputs and outputs.
- Never hide failures.
- Make tools idempotent whenever possible.
- Keep the number of exposed tools manageable.

A surprising lesson?

After about **15 tools**, adding more highly specialized tools often reduces selection accuracy.

Sometimes fewer, broader tools perform better because they consume less context and make better decisions.

---

### Production Starts Where Happy Paths End

A mature harness isn’t judged by whether a tool works.

It’s judged by what happens **when it doesn’t.**

Your harness should anticipate:

- Wrong tool selection
- Invalid arguments
- Hallucinated tools
- Infinite retries
- Slow APIs
- Network failures
- Permission denials
- Malformed outputs
- Timeouts
- Duplicate executions
- Partial success

These aren’t edge cases.

They’re everyday production scenarios.

---

### Harness Engineering Is Everything Around the Tool

If you draw the architecture of an AI agent, the tool itself occupies surprisingly little space.

Almost everything else is harness:

- registering tools
- advertising capabilities
- validating requests
- enforcing permissions
- executing safely
- observing failures
- normalizing responses
- feeding results back into the reasoning loop

That’s why I say:

> **The model isn’t dangerous. The harness is.**

The model can only act through the software architecture you build around it.

If that architecture is weak, the smartest model in the world will still make catastrophic mistakes.

---

### A Simple Exercise

Find the riskiest tool in your system.

Look for one containing words like **delete**, **deploy**, or **destroy**.

Now walk it through each stage of the lifecycle.

If any stage is missing—validation, permissions, observability, normalization, or human approval—that’s your next engineering task.

Because production-grade AI isn’t about making the model smarter.

It’s about making the harness safer.
