AI tool boundaries
Treat a model’s tool call like untrusted structured input:
- Expose a narrow operation, not generic SQL or shell access.
- Validate schema and semantic constraints in code.
- Re-authorize using the current user/service identity.
- Make side effects explicit and idempotent where retries are possible.
- Return bounded results without secrets.
- Log an auditable decision/action record.
Example tool shape:
{ "name": "get_order_status", "description": "Return the caller-authorized status of one order.", "input_schema": { "type": "object", "properties": { "order_id": { "type": "string" } }, "required": ["order_id"], "additionalProperties": false }}The description helps the model choose the tool; it is not access control. The server must derive tenant/user scope from trusted execution context rather than accept it from model arguments.