AI and agents · Tools and controls · 5 min

Tool engineering: tools an agent can use safely

Tools are not neutral extensions: they require contracts, validation and interpretable results.

Tool callingIntegrationsSecurity

A tool is a trust boundary

When an agent queries a system or runs an operation, it crosses a boundary between probabilistic language and deterministic systems. The contract must be explicit: typed inputs, permissions, time limits and output format.

Validation must not be delegated to the model. The receiving service checks schema, identity, authorization and business rules before producing any effect.

Intent
Tool contract
Validated result
Schema · authorization · timeout · audit

Results that support decisions

A tool response needs status, evidence and actionable errors. An ambiguous error encourages useless retries; a structured one lets the harness change strategy or ask for help.

Actions with external effects require idempotency, an audit log and human confirmation when the impact is material.

Reading the diagram

How to read this system

  1. 01The request is interpreted as intent; the agent chooses a capability with an explicit contract.
  2. 02Search, data and code tools receive typed inputs, not unvalidated natural-language instructions.
  3. 03Each result returns status, evidence and an actionable error so the agent can stop, correct or escalate.
  4. 04Error handling feeds back into the plan but does not allow unlimited retries.

Essential concepts

Technical terms

Tool calling
Structured invocation of an external capability.
Schema
Formal definition of accepted fields and types.
Idempotency
Repeating an action without duplicating its effect.

Architecture

Implications and controls

The tool layer acts as a secure adapter between the agent and internal systems. Authorization and business rules are checked at the receiver, even if the agent already evaluated them.

Risks to consider

  • Malformed parameters.
  • Privilege escalation.
  • Duplicated changes or ambiguous errors.

Checklist

  • Document purpose, schema and effects.
  • Validate business rules server-side.
  • Normalize errors and time limits.
  • Use idempotency for external actions.

Conclusion

A safe tool turns intent into a valid, authorized and verifiable request.