Writing

AI · 4 min read

What Claude’s Guardrails Teach Me About Building Agents

Claude refusing a request tells me about one response. Before I connect an agent to real tools, I need to know what a mistaken call could do.

In this article4 sections

Claude Code sometimes refuses ordinary work in my repositories, and I cannot tell which boundary I reached. I want it to explain what it is uncertain about so I can clarify the task.

I keep using it because it helps me get work done. But a refusal tells me about one response. It does not tell me what would happen if the model made the wrong tool call.

Before I connect an agent to an account or a dataset, I need to understand both its behavior and the access I am giving it.

The model’s behavior is one boundary

A provider can train a model to decline some requests. The application decides which tools and accounts that model can reach. I need to check both.

LayerWhat I want to understand
Model behaviorHow the model interprets the task and responds to uncertainty
Tool permissionsWhich actions the application allows it to take
ReviewWhich changes need a person to inspect the result
EvaluationWhether the system behaves as intended in realistic tests

Anthropic’s discussion of distillation attacks raises the risk of transferring capabilities without the original service’s safeguards. A safeguard I rely on in one service may not be present in another deployment.

Constitutional AI shapes model behavior around stated principles. I want to see those principles in a decision: when does the agent ask for clarification, decline a request, or leave the choice to me?

A refusal gives me something to investigate. I can clarify the task, reduce its scope, and inspect what the agent proposes. That helps me distinguish a misunderstanding from a restriction I need to account for.

Tool permissions have to enforce their own limits

A model deciding not to take an action and an application preventing that action are different controls. In a hypothetical deployment, an agent might correctly refuse to delete production data. If the connected account still has deletion permission, that refusal does not establish that the application would block a mistaken tool call.

The permission should match the job. An agent asked to inspect a system can receive read access; a proposed change can wait for review. This limits what a mistake can do while leaving the model room to investigate. A test should check that the restriction holds when the model attempts the action, rather than only checking whether it usually declines.

A refusal can also block legitimate work

A model may not have enough information to distinguish authorized work from misuse. That makes a refusal understandable. It can still leave legitimate work unfinished.

Consider an authorized engineer trying to contain a service incident: a tool that cannot help investigate or propose a repair may leave the engineer with fewer options when time matters. That is a hypothetical example, not an incident I have measured with Claude.

I want the agent to explain what is uncertain, ask for the missing authorization, and continue with the parts it can safely perform. That preserves initiative without treating urgency as permission to do anything. Testing should examine both harmful actions the system allows and legitimate work it unnecessarily blocks.

Test the deployment people will actually use

The same model can be connected to a read-only account in one application and a production account with write access in another. A test of the model’s answers alone would miss that difference.

Anthropic’s case for third-party testing gives independent evaluation an important role. I want to know what access a test gave the agent, what it attempted, and which actions the application actually blocked.

That also informs how I think about public code and open models. Access to code or weights gives people more to inspect. I still need evidence about the system built around them.

Before I give an agent credentials, I want to know what happens when it tries an action it should not take. A good answer from the model is useful. A permission check that blocks the action is something I can test separately.

Was this useful?

What was missing?

Thanks for the feedback.