AXTHORM

© AXTHORM

Developer library

Give an AI agent bounded tools

Start with read-only tools. Keep prices, stock, authorization and payments in backend services that enforce business rules.

Walkthrough

1. Define a narrow tool

Accept a validated SKU and return only what the agent needs.

2. Put an approval gate before writes

Have the user confirm the intent and let the server recheck authorization and inventory.

3. Evaluate the workflow

Test ambiguous requests, stale data, missing permissions and injected instructions.

Worked example

An inventory agent may read stock. Creating an order goes through a different endpoint that checks confirmation and the customer’s permissions.

TypeScript · example tool contract
type LookupStock = { sku: string };
type StockResult = { sku: string; available: boolean };
// Validate the SKU and caller before querying inventory.
Show another code example
JavaScript · action boundary
if (!confirmation || !canCreateOrder(session, cart)) {
  throw new Error("Confirmation or permission missing");
}
return createOrder(cart, idempotencyKey);

Try it yourself

Who decides whether an order is authorized?