Have you ever wondered how your AI agent or chatbot ensures that the information it gives you is accurate and not just a guess? Well, there's an exciting new tool called Tool Evidence Guard (version 0.1.0) designed specifically to solve this problem. Imagine you ask your agent a question, and it goes off to find the answer using a specific tool. Sometimes, this tool might fail to return anything, or it might provide incorrect data. The real issue isn't just the tool's failure, but that the agent might continue as if it received enough information, giving you an answer that might not actually exist!

This tool, a local library and command-line interface written in Python (requiring Python 3.10 or newer), acts as a strict 'data guard'. Before your agent uses any information to form a response, Tool Evidence Guard thoroughly checks it. The main goal is to ensure the data meets a pre-defined 'contract,' which is a set of conditions and requirements the data must fulfill.

The core point here is that 'OK' doesn't necessarily mean the data is true, but rather that it conforms to the specified conditions. For example, if the agent expects a non-negative integer at a specific location, and it receives a null value, that value fails the contract. It also doesn't authorize the agent to invent a number from thin air. The system running the tools defines upfront what it needs: a specific data type, a value within a certain range, or a defined set of accepted values.

When a tool returns a result, Tool Evidence Guard processes three elements: the `contract` (pre-established requirements), the actual `result` (captured output), and any structured `claims` the agent wants to support with that output. For instance, it ensures that 0 and `false` are treated as valid and distinct values, not as absences of data. Crucially, both the contract definition and data capture must come from a trusted execution layer, not from the AI model itself that drafts the response. Why? Because if the model could invent both, a coherent but entirely false document might pass validation.

The current 0.1.0 version can verify specific data types like integers, numbers, strings, and booleans, and can enforce restrictions such as minimum, maximum, or an enumeration of allowed values. It also rejects declared errors, missing required fields, incorrect types, and even recognizes redaction markers like [REDACTED] to ensure improperly hidden information isn't passed through. In short, this means we, as the audience, will get more accurate and reliable answers from AI agents because they won't be able to 'make up' facts when encountering incomplete or incorrect data. It's a significant step towards making our interactions with AI more trustworthy and transparent.