DEV Community

Cover image for Your AI Agent Trusted the Tool. The Tool Changed Overnight.
Atul Kumar
Atul Kumar

Posted on Edited on

Your AI Agent Trusted the Tool. The Tool Changed Overnight.

Schema hashing helps catch silent tool changes

Subtitle: How changing MCP servers, modified tool schemas, and silent permission expansion can turn a previously safe AI workflow into a production security incident.

I have started looking at AI agent reliability from a slightly different angle. We spend a lot of time discussing whether an agent makes the right decision, whether it uses the correct data, and whether it can recover when an API call fails. But there is another question that deserves the same attention:

What happens when the tool an agent trusts is no longer the tool it originally trusted?

Imagine building an AI assistant for an operations team. You give it access to an MCP server with three tools. One reads order details, another checks inventory, and the third retrieves shipment status. You review the available tools, approve their use, configure permissions, and test the workflow. Everything behaves as expected.

A few weeks later, the MCP server is updated. The tool named get_order_details still exists. The connection still works. Authentication succeeds. The agent sees a familiar tool name and continues using it.

But the implementation behind that name has changed. Perhaps the tool now returns additional customer information. Perhaps its input schema accepts a new parameter that enables a more powerful operation. Perhaps the tool description has changed in a way that encourages the model to use it differently.

Nothing in the agent's original approval necessarily tells it that the security assumptions have changed. This is the problem I want to explore. We often treat tool approval as a one-time decision. In a system where tools, schemas, permissions, and server implementations evolve independently, that assumption is dangerous.

The tool you approved may not be the tool you are calling

An AI agent does not interact with a tool in the same way a developer interacts with a fixed function in a traditional application.

A developer might import a function from a known package, review its implementation, lock its dependency version, and deploy it as part of a controlled release. An AI agent, particularly one using MCP, can discover tools dynamically, inspect their descriptions, and decide which one to call based on the context of a task.

That flexibility is useful. It is also a new trust boundary. Consider an MCP server exposing this tool:

{
  "name": "get_order_details",
  "description": "Retrieve order information using an order ID.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "order_id": {
        "type": "string"
      }
    },
    "required": ["order_id"]
  }
}
Enter fullscreen mode Exit fullscreen mode

The agent is allowed to retrieve an order using its identifier. The application might enforce a read-only permission, and the tool might return only the information required by the workflow. Now imagine that the server is updated and exposes this:

{
  "name": "get_order_details",
  "description": "Retrieve order information, customer contact details, and internal account notes.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "order_id": {
        "type": "string"
      },
      "include_customer_profile": {
        "type": "boolean",
        "default": true
      },
      "include_internal_notes": {
        "type": "boolean",
        "default": true
      }
    },
    "required": ["order_id"]
  }
}
Enter fullscreen mode Exit fullscreen mode

The tool still has the same name. It may even be operated by the same organisation. But its behaviour and the data it can expose have changed.

This is not necessarily a malicious update. It could be a legitimate feature release. The problem is that a previously approved capability has silently become broader.

The agent may now have access to information that was never part of the original security review. This is why I would separate the three questions:

  1. Is this the tool we intended to connect to?
  2. Is this the exact version of the tool contract we approved?
  3. Does this particular invocation have permission to perform this particular action?

Those questions are related, but they are not interchangeable. A familiar name answers none of them reliably.

MCP makes tool discovery dynamic, so trust must be dynamic too

One of the useful characteristics of the Model Context Protocol is that clients can discover tools exposed by servers rather than requiring every integration to be hardcoded into the application.

A server can expose a list of tools and their input schemas. Clients can use that information to understand what operations are available. MCP also provides a mechanism for servers to notify clients when their tool list changes.

This is valuable for extensibility. A server can add a capability without requiring an entirely new client implementation.

However, dynamic discovery introduces a security question that traditional static integrations often handle differently: what should happen when the available capabilities change after approval?

Suppose an agent connects to an MCP server at startup. It discovers ten tools, loads their descriptions into its context, and begins processing requests.

Later, the server changes one of those tools. If the client never checks for changes, it might continue operating using an outdated understanding of the server. If it automatically accepts every new tool definition, it might accept a capability expansion without review.

Neither behaviour is a good security policy. The important distinction is between discovering a tool and trusting a tool. Discovery tells the client what the server currently offers. Trust determines whether the application is willing to allow the agent to use that capability.

A tool list is not an authorisation policy.

Tool names are not identities

One of the first changes I would make in an agent architecture is to stop treating a tool name as its identity. A tool named update_customer_record is just a label. Another server can expose a tool with exactly the same name and completely different behaviour.

Even the same server can change the implementation behind that name. For security purposes, I would identify a tool using a combination of attributes:

  • The identity of the MCP server.
  • The authenticated server endpoint or deployment identity.
  • The tool name.
  • The approved input schema.
  • The approved output contract, where relevant.
  • The version of the tool implementation or signed release.
  • The capabilities and permissions granted to the tool.

This creates a much stronger identity model. For example, the application might maintain a trusted tool manifest:

{
  "server_id": "orders-mcp-production",
  "server_identity": "orders-service-prod",
  "tool_name": "get_order_details",
  "tool_version": "1.4.2",
  "schema_fingerprint": "sha256:approved-fingerprint",
  "allowed_capabilities": [
    "orders.read"
  ],
  "approval_status": "approved"
}
Enter fullscreen mode Exit fullscreen mode

The fingerprint is illustrative, not a real digest. In a real implementation, it would be calculated from a canonical representation of the approved schema.

The point is that the application now has something concrete to compare against.

If the server returns a different schema, the application can detect that the tool contract has changed. It does not have to ask the language model whether the change looks safe.

That decision belongs to the security and policy layer.

Detecting a changed schema before the agent uses it

A schema fingerprint is a useful starting point. The application can serialise a tool schema into a deterministic representation and calculate a cryptographic hash. If the schema changes, the hash changes as well. Here is a simplified Python example:

import hashlib
import json

def schema_fingerprint(schema: dict) -> str:
    canonical = json.dumps(
        schema,
        sort_keys=True,
        separators=(",", ":"),
        ensure_ascii=False
    )

    digest = hashlib.sha256(
        canonical.encode("utf-8")
    ).hexdigest()

    return f"sha256:{digest}"
Enter fullscreen mode Exit fullscreen mode

The use of sorted keys and consistent serialisation matters. Two JSON objects with identical meaning should not produce different fingerprints simply because their properties appear in a different order.

However, this example is intentionally simple. A production implementation needs a defined canonicalization policy, including how it handles schema references, defaults, descriptions, omitted fields, and version-specific metadata.

It should also distinguish between changes that affect security and changes that do not.

For example, changing a spelling mistake in a description may not require the same response as adding a new parameter that exposes private information.

I would therefore keep two fingerprints where appropriate:

Contract fingerprint: Represents the complete approved tool definition, including descriptions and metadata that influence model behaviour.

Capability fingerprint: Represents the security-relevant aspects of the tool, such as accepted inputs, exposed data, side effects, and required permissions.

This distinction matters because descriptions are not harmless documentation in an AI system. The model may use them to decide when and how to call a tool.

A changed description can influence behaviour even if the input schema remains identical.

At the same time, a schema fingerprint alone cannot prove that the server's implementation is unchanged. A server can preserve its schema while changing what happens behind the API.

That is why schema verification must be combined with server identity, release provenance, runtime authorisation, and implementation controls.

A practical runtime verification layer

I would place a tool verification layer between the MCP client and the agent's tool execution interface. The agent can request a tool call, but the request does not go directly to the MCP server. Instead, the verification layer checks whether the tool is still approved.

The flow looks like this:

             User Request
                  |
                  v
             AI Agent
                  |
                  v
          Proposed Tool Call
                  |
                  v
        +---------------------+
        | Tool Verification   |
        |                     |
        | Server Identity     |
        | Tool Identity       |
        | Schema Fingerprint  |
        | Capability Policy   |
        +---------------------+
                  |
          +-------+-------+
          |               |
          v               v
      Approved         Changed or
       Contract        Untrusted
          |               |
          v               v
    Authorisation Block Call
       Check          Alert / Review
          |
          v
    Input Validation
          |
          v
       MCP Server
          |
          v
    Result Validation
          |
          v
       AI Agent
Enter fullscreen mode Exit fullscreen mode

The important design decision is that the model does not control the verification result.

It can propose a tool invocation, but the application decides whether that invocation is permitted.

Here is a simplified implementation:

class ToolTrustError(Exception):
    pass


class ToolVerifier:

    def __init__(self, approved_manifest):
        self.approved_manifest = approved_manifest

    def verify(self, server_id, tool_name, schema):
        key = f"{server_id}:{tool_name}"

        approved = self.approved_manifest.get(key)

        if approved is None:
            raise ToolTrustError(
                "Tool is not registered as trusted"
            )

        current_fingerprint = schema_fingerprint(schema)

        if current_fingerprint != approved["schema_fingerprint"]:
            raise ToolTrustError(
                "Tool contract changed after approval"
            )

        if approved["approval_status"] != "approved":
            raise ToolTrustError(
                "Tool is not currently approved"
            )

        return True
Enter fullscreen mode Exit fullscreen mode

The example deliberately fails closed. If the current contract does not match the approved contract, the tool invocation is blocked.

It is important to understand what this code does not do. It does not authenticate the MCP server, prove the server's implementation integrity, validate every input, or enforce authorisation at the resource level. Those controls need to exist separately.

The verifier is one part of the trust boundary, not the entire security architecture.

A changed schema should not automatically mean a malicious tool

There is an important balance here.

I would not want every harmless update to stop an entire production workflow. At the same time, I would not want a tool to gain new permissions just because the server owner added a field.

The answer is a controlled change-management process.

When the application detects a changed tool definition, it should compare the current contract with the approved version and classify the difference.

For example:

Change Possible security impact Suggested response
Description wording changed Model behaviour may change Review and reapprove
Optional input added May expand invocation behaviour Block pending review
Required input changed Existing calls may behave differently Block and test
Output fields expanded May expose additional data Review data permissions
New write operation New side-effect capability Explicit approval
Server identity changed Trust boundary changed Reject connection
Implementation digest changed Code provenance changed Verify release and reapprove

The exact classification depends on the application.

A change to a tool's description might be low risk in a tightly controlled workflow, but it should not automatically be ignored. A description can contain instructions that influence an agent's behaviour.

A new parameter might also be harmless if it only changes formatting. But if it enables access to internal customer records, it changes the security boundary. The important thing is to make that assessment explicit. I would not allow the language model to decide whether its own tool has become trustworthy. That is a circular security model.

The more dangerous problem: schema unchanged, implementation changed

This is where I think many implementations could develop a false sense of security. Imagine that the original tool has this interface:

def get_order_details(order_id: str):
    return database.get_order(order_id)
Enter fullscreen mode Exit fullscreen mode

The tool is read-only and returns the order associated with the supplied identifier. The server is then updated:

def get_order_details(order_id: str):
    order = database.get_order(order_id)

    audit_service.record_access(order_id)

    return {
        "order": order,
        "customer_profile": database.get_customer(
            order.customer_id
        ),
        "internal_notes": database.get_internal_notes(
            order.customer_id
        )
    }
Enter fullscreen mode Exit fullscreen mode

The input schema has not changed at all. The tool still accepts one string called order_id. A schema fingerprint will not detect this implementation change.

The problem is no longer just tool discovery. It is software supply-chain trust. For sensitive MCP servers, I would combine schema verification with additional controls:

1. Server identity verification. The client should authenticate the server and verify that it is connecting to the expected deployment. TLS protects the connection, but the application should also establish the expected service identity.

2. Release provenance. Deployments should have traceable release versions and, where supported, signed artefacts or attestations. The client or deployment platform should be able to establish which approved build is running.

3. Capability enforcement outside the tool. A read-only agent should not become capable of accessing private records simply because a tool implementation starts returning them. The backend must enforce resource-level authorisation.

4. Output filtering. Results should be checked against the data classification and output contract expected by the workflow.

5. Change monitoring. A server release should produce an auditable event that can be compared with the approved deployment state.

The key principle is simple: the schema tells us what a tool claims to accept. It does not prove everything the implementation can do.

The permission problem is bigger than the tool description

I would also avoid giving an agent broad permissions simply because one of its tools needs a particular capability. For example, suppose an agent can retrieve order details and initiate refunds.

A poorly designed system might give the MCP server a general-purpose database credential and a payment API key with broad access. The tool interface might look harmless, but the underlying credentials could allow far more than the agent's approved workflow.

Instead, permissions should be enforced at the action level. For instance:

POLICIES = {
    "get_order_details": {
        "capabilities": ["orders. read"],
        "effect": "read"
    },

    "reserve_inventory": {
        "capabilities": ["inventory.reserve"],
        "effect": "write"
    },

    "issue_refund": {
        "capabilities": ["payments.refund"],
        "effect": "financial"
    }
}
Enter fullscreen mode Exit fullscreen mode

Before executing a call, the application should verify that the authenticated agent has the required capability.

It should also check the resource being accessed, the user's authority, and any business constraints. A tool name is not a permission. A schema is not a permission.

A successful authentication handshake does not permit performing every operation exposed by the server.

This distinction becomes especially important when several agents share the same MCP server. A research agent may need read-only access, while an operations agent may need permission to reserve stock. They should not inherit the same capabilities just because they use the same connection.

Bind approvals to the actual action

There is another problem that appears when a tool invocation requires human approval.

Imagine an agent proposes a refund of ₹25,000. A person reviews the request and approves it. Before execution, the agent changes the amount to ₹75,000. If the system records only that the refund tool was approved, the approval may accidentally be reused for a different action. I would bind the approval to the actual invocation.

That means recording:

  • The server identity and tool identity.
  • The approved tool contract version.
  • The exact resource being affected.
  • The action parameters.
  • The amount or other sensitive business values.
  • The authenticated requester.
  • The approval identity.
  • An expiry time.
  • A unique, single-use approval identifier.

A simplified approval payload might look like this:

{
  "approval_id": "approval-8912",
  "tool": "issue_refund",
  "tool_version": "2.1.0",
  "schema_fingerprint": "sha256:approved-fingerprint",
  "order_id": "ORD-2048",
  "amount": 25000,
  "currency": "INR",
  "approved_by": "finance-manager",
  "expires_at": "2026-11-25T12:00:00Z",
  "single_use": true
}
Enter fullscreen mode Exit fullscreen mode

Before executing the refund, the application should compare the proposed action against the approved action.

If the amount, order, destination, or tool contract has changed, the old approval should no longer be valid. This is important because approval is not a general permission slip. It is authorisation for a specific action under specific conditions. The execution layer should also enforce the approval independently. It should not trust the agent to preserve the approved parameters.

What if the tool changes while the workflow is running?

This is a classic time-of-check versus time-of-use problem.

The agent might discover and verify a tool at the beginning of a workflow. Several minutes later, it might invoke that tool after the server has been updated.

A check performed at startup does not guarantee that the tool remains unchanged at execution time. For sensitive operations, I would verify the contract at the point of invocation.

The sequence should look like this:

  1. Discover the available tool.
  2. Compare its identity and contract with the approved manifest.
  3. Authorise the specific action.
  4. Validate the input against the approved schema.
  5. Check that the server identity and approved release remain valid.
  6. Execute the call.
  7. Validate the response and record the execution evidence.

For long-running workflows, the system should also define what happens when a tool changes between steps.

I would not automatically restart the entire workflow using the new contract. Nor would I silently continue using an old assumption if the server's implementation has been replaced.

Instead, the workflow should preserve the tool version and approval context under which it started.

If the new release is not compatible with that context, the next sensitive operation should stop until the system can establish that it is safe to proceed.

This is particularly important when the workflow contains irreversible operations such as issuing refunds, changing customer permissions, placing orders, or submitting financial transactions.

A tool update should not rewrite the security assumptions of an already-running workflow.

What should happen when verification fails?

I would use explicit states rather than returning a generic tool error.

For example:

State Meaning System behaviour
APPROVED Contract matches approved manifest Continue policy checks
UNAPPROVED Tool has no approved identity Block invocation
SCHEMA_CHANGED Contract differs from approved version Quarantine and review
SERVER_IDENTITY_MISMATCH Server identity cannot be verified Reject connection
RELEASE_UNVERIFIED Implementation provenance is uncertain Block sensitive actions
CAPABILITY_DENIED Action exceeds granted permission Reject invocation
APPROVAL_EXPIRED Human approval is no longer valid Request fresh approval
MANUAL_REVIEW_REQUIRED Change cannot be safely classified Escalate

The distinction matters operationally.

A schema change is not necessarily evidence of an attack. But it is evidence that the original approval no longer describes the current contract.

The system should record the observed version, the approved version, the reason for rejection, and the action that was blocked. The agent can then explain that the operation could not proceed because the tool contract changed. It should not be allowed to bypass the restriction by asking for another tool with a similar name.

Build a replay test for tool changes

I would not consider this security control complete until it can be tested automatically.

A useful test suite should contain at least four scenarios.

Scenario 1: An approved tool remains unchanged.

The server identity, tool schema, and approved release match. The tool invocation passes verification and continues to authorisation.

Scenario 2: A new optional parameter appears.

The tool retains its name but now accepts an additional parameter. The verifier detects the contract change and blocks the call pending review.

Scenario 3: The schema remains unchanged, but the server release changes.

The schema fingerprint matches, but the deployment identity or release provenance no longer matches the approved manifest. The system must not assume that the implementation is safe simply because the interface looks familiar.

Scenario 4: A previously approved tool attempts a broader action.

The contract may be valid, but the requested action requires a capability that the agent does not possess. The authorisation layer rejects it.

Here is a simple example using Python:

def test_approved_tool_is_accepted():
    verifier = ToolVerifier(approved_manifest)

    assert verifier.verify(
        "orders-mcp-production",
        "get_order_details",
        approved_schema
    )


def test_changed_schema_is_rejected():
    verifier = ToolVerifier(approved_manifest)

    try:
        verifier. verify(
            "orders-mcp-production",
            "get_order_details",
            modified_schema
        )
    except ToolTrustError:
        return

    raise AssertionError(
        "Changed tool schema was accepted"
    )
Enter fullscreen mode Exit fullscreen mode

These are deliberately small examples. In a real test suite, I would use pytest, fixtures, explicit exception assertions, and integration tests against a controlled MCP server.

I would also test that a notification about changed tools invalidates the appropriate cached contract, that a server restart does not silently restore trust, and that a worker handoff preserves the approved manifest version.

One especially important test is this:

If the same changed tool is presented ten times, does the system consistently reject it until an explicit approval event occurs?

If the answer depends on which agent receives the request, or which worker happens to process it, the trust policy is not deterministic enough.

Tool changes should be auditable events

There is a final engineering detail I would not leave out: the audit trail.

When an agent is blocked from using a tool, the system should record enough information to explain why.

A useful event might contain:

{
  "event": "TOOL_CONTRACT_REJECTED",
  "server_id": "orders-mcp-production",
  "tool_name": "get_order_details",
  "approved_fingerprint": "sha256:old-fingerprint",
  "observed_fingerprint": "sha256:new-fingerprint",
  "approved_version": "1.4.2",
  "observed_version": "1.5.0",
  "workflow_id": "workflow-7831",
  "agent_id": "order-assistant",
  "decision": "BLOCKED",
  "reason": "APPROVED_CONTRACT_MISMATCH"
}
Enter fullscreen mode Exit fullscreen mode

This makes the decision reproducible.

It also helps distinguish a legitimate deployment from a suspicious change, a configuration error, or a compromised server.

I would keep these events append-only and correlate them with the actual tool invocation attempts. Sensitive credentials, access tokens, and customer data should never be written into the audit log.

The goal is not simply to know that a tool failed.

The goal is to know which contract the application trusted, which contract it observed, which policy it applied, and why the invocation was allowed or rejected.

The architecture I would actually trust

If I were designing this for a production environment, I would separate the responsibilities into four layers.

The discovery layer communicates with MCP servers and retrieves the current tools and schemas. It does not grant permission merely because a tool is discoverable.

The trust layer verifies server identity, approved tool identity, contract fingerprints, release provenance, and version compatibility. It compares observed information against a versioned trusted manifest.

The authorisation layer checks the agent's identity, user authority, resource-level access, action permissions, approval records, and business constraints. It evaluates the actual invocation rather than relying on the tool's description.

The execution layer sends the request, validates the response, records the execution result, and provides evidence for audit and recovery.

This separation prevents a common architectural mistake: allowing the language model to become responsible for both choosing an action and deciding whether the infrastructure is safe enough to execute it.

The agent should be able to propose. The policy layer should decide. The execution layer should enforce. And the audit layer should preserve evidence of what happened.

A practical checklist before deploying an MCP integration

Before I allow an AI agent to use an MCP server in production, I would want clear answers to these questions:

  • [ ] Is the MCP server authenticated and bound to an expected identity?
  • [ ] Is the approved tool manifest version-controlled?
  • [ ] Are tool definitions compared against approved fingerprints?
  • [ ] Are descriptions and metadata changes reviewed when they can influence model behaviour?
  • [ ] Is implementation provenance verified independently of the schema?
  • [ ] Are capabilities enforced outside the language model?
  • [ ] Are credentials scoped to the minimum required operations?
  • [ ] Are sensitive outputs checked against data-access policies?
  • [ ] Are human approvals bound to exact action parameters?
  • [ ] Are tool changes detected during long-running workflows?
  • [ ] Are changed or unverified tools blocked by default?
  • [ ] Are all verification decisions recorded in an auditable event history?
  • [ ] Can the security tests reproduce the same decision across retries and worker handoffs?

Not every tool needs the same level of control. A low-risk calculator does not need the same release verification and approval workflow as a tool that can transfer money or modify customer permissions.

But the trust boundary should be explicit in both cases.

The bigger lesson: trust should expire when its assumptions change

I think we have spent a lot of time discussing how an AI agent should decide which tool to call. That is an important problem, but it is only half of the story.

A tool can be selected correctly and still be unsafe to execute.

An agent can follow its instructions perfectly and still operate against a changed interface, a broader permission set, or a different implementation than the one originally reviewed.

This is why I would not treat tool approval as a permanent property attached to a name.

I would treat it as a versioned security decision, tied to an authenticated server identity, a known contract, a verified implementation, and a defined set of capabilities.

When one of those assumptions changes, the application should reassess trust before allowing the next sensitive action.

The language model should not be expected to notice every security-relevant change in a tool description. It should not be asked to determine whether a new parameter is safe. And it should never be allowed to grant itself additional authority simply because a server exposes a new capability.

The most reliable design is one in which the agent can discover new tools, but cannot automatically trust them.

Because in production, the dangerous part is not always that an AI agent makes a bad decision.

Sometimes it makes exactly the decision it was designed to make, using a tool that is no longer what the system originally approved.

The tool's name stayed the same. The trust assumptions did not.

Top comments (84)

Collapse
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

The get_order_details example is the sharpest part — same name, a new include_internal_notes parameter defaulting to true, and nothing in the original approval covers it. I'd push one step further: even a perfect schema fingerprint doesn't catch the case where the schema stays identical and the implementation quietly starts returning the customer profile anyway, which your own section admits. Do you think the practical answer is output filtering at the gateway, or is that just moving the trust problem one layer out?

Collapse
 
katul1512 profile image
Atul Kumar •

I think output filtering at the gateway is necessary, but it shouldn't become the only line of defence. You're right that an unchanged schema doesn't guarantee unchanged implementation behaviour. A tool could start returning additional sensitive fields without any contract-level change. I'd use the gateway to enforce a deterministic response-field allowlist based on the approved operation and caller permissions, rather than trusting whatever the backend returns. But I'd combine that with server-side authorisation and resource-level access controls. The gateway limits what reaches the agent; the backend must still enforce what the tool is allowed to access. Ultimately, we're not eliminating trust; we're distributing enforcement across independent boundaries so that one compromised layer doesn't expose everything.

Collapse
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

That's the right framing — you're not eliminating trust, you're distributing enforcement so no single layer failing exposes everything. The gateway allowlist catches exactly the silent-extra-fields case, and the backend auth catches the tool that was over-permissioned from the start. How do you keep the allowlist in sync with approved operations as they change?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I'd keep the allowlist versioned alongside the approved operation manifest rather than maintaining it as a separate configuration. Every approved operation should define its permitted input parameters, response fields and access scope. When the contract changes, the policy and allowlist should be reviewed and released together as one versioned unit. At runtime, the gateway checks that the operation's manifest version matches the policy version before filtering the response. If they drift, execution should pause rather than fall back to a broader default. This keeps the approval, permissions and actual data exposure tied to the same contract.

Thread Thread
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

Pausing on drift instead of falling back to a broader default is the move that makes the whole scheme fail-closed — a version mismatch becomes a stop, not a silent widening. Tying the approval, the permissions and the actual data exposure to one versioned unit also kills the usual drift where the policy says one thing and the gateway enforces another. When execution pauses, does that surface to an operator, or does the agent just stall waiting?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I'd make it an explicit, auditable state rather than letting the agent simply stall. The operator should receive a clear alert explaining which version changed, what validation failed and why execution was paused. The agent can receive a controlled response such as CONTRACT_VERSION_MISMATCH, but it shouldn't be allowed to bypass the check or retry with broader permissions. Once the change is reviewed and approved, execution can resume against the updated contract. The important thing is that uncertainty becomes visible to both the system and the people responsible for it.

Thread Thread
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

That's a stronger answer than either option I offered — making the mismatch an explicit, auditable state instead of a silent stall or a quiet retry. The part I'd underline is the no-bypass rule: once the agent can route around a failed check, the contract isn't a gate anymore. In your setup, does the operator review happen in the loop before execution resumes, or is it an async queue the agent waits on?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I'd favour an asynchronous review queue, with execution remaining paused until an authorised operator explicitly resolves the issue. This avoids blocking the entire system while ensuring the agent cannot bypass the decision. The review should capture the mismatch, the affected contract version and the reason for approval or rejection. Once cleared, the orchestrator can resume execution against the newly approved version. Importantly, the agent should only receive the outcome, not control over the review process. Human oversight should remain an independent authority, not another tool the agent can invoke to approve itself.

Thread Thread
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

The last point is the one that matters most — oversight stops being oversight the moment the agent can invoke its own approval. An async queue with execution paused is the right shape, but it raises a practical question: who counts as the authorised operator here, and does the queue distinguish roles, or is any human with access enough to clear it?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I'd make authorization role-based rather than treating every human with system access as an authorised operator. The person clearing a routine contract mismatch may not need the same privileges as someone approving expanded data access or a financial operation. I'd define permissions based on the risk and impact of the requested change, with stronger approval requirements for sensitive actions, potentially including a second reviewer. Every decision should also be recorded with the operator's identity, role, rationale and timestamp. Human involvement alone doesn't guarantee oversight; the right person needs the right authority, and that authority must be independently verifiable.

Thread Thread
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

Role-based is the right correction — my question was too flat about who counts as authorised. Risk-tiered approval with a second reviewer for the sensitive tier is the shape that actually holds up. The part I'd push on: does the audit record capture the role the operator held at decision time, or just their identity? A role change after the fact shouldn't rewrite what the approval meant.

Thread Thread
 
katul1512 profile image
Atul Kumar •

That's an important detail. I'd capture both the operator's identity and their role, including the specific permissions and authorisation scope they held at the time of approval. Ideally, the audit record would also preserve the relevant policy version and approval timestamp. These details should be immutable, so a later role change cannot retroactively alter the meaning or validity of an earlier decision. An audit should explain not just who approved an action, but whether they were authorised to approve it at that exact moment. Otherwise, accountability becomes difficult to establish when something goes wrong.

Thread Thread
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

That's the right standard — identity alone was never the question, authorisation at that exact moment was, and the policy version is the part most audits skip. The tension is cost: immutable, versioned records for every approval is real plumbing. Do you see teams actually building that, or does it stay a principle most settle for approximating?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I think we're seeing both, depending on the risk profile of the system. In lower-risk workflows, teams often approximate this with application logs and approval metadata. But for financial transactions, sensitive data access, or actions with regulatory implications, that approach becomes difficult to defend. The good news is that immutable auditability doesn't necessarily mean building an entirely separate infrastructure. A versioned approval record, policy reference, timestamp, operator identity and exact action payload can be captured as part of the existing orchestration flow. I'd start with the actions where accountability matters most and expand from there. The cost of recording a decision is usually far lower than the cost of being unable to explain why it was authorised.

Thread Thread
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

The risk-tiered framing is the right one — starting with the actions where accountability matters most keeps this from becoming a second infrastructure project. One gap I'd still poke at: the versioned record captures the action payload that was authorised, but the drift in your get_order_details example is on the return side — the tool quietly returning more than was asked. Does your record also capture what came back, or is the return path still trusting the tool?

Thread Thread
 
katul1512 profile image
Atul Kumar •

That's a fair point. Capturing the authorised payload is only half the accountability story. I'd extend the record to include the actual tool response as well, ideally with a timestamp, tool and version identity, response schema or contract version, and a hash of the returned data. The important part is not just storing the raw response, but validating it against the expected output contract before the agent can use it. If get_order_details is expected to return an order ID, status and total, but suddenly starts returning additional customer or payment information, the gateway should detect that change and apply an explicit policy: reject the response, filter unexpected fields, or route it for review depending on the sensitivity.

I'd also preserve both the original response and the validated response in the audit trail, with appropriate protection for sensitive data. That gives us a way to reconstruct not only what the agent was authorised to do, but also what information it actually received and what it was allowed to act on. So yes, the return path needs the same discipline as the execution path. A trusted tool should never mean an unrestricted response.

Thread Thread
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

The original-plus-validated pair is the part I'd steal — it turns a drifted response into something you can actually reconstruct after the fact, not just notice. The open question for me is who owns the expected contract: if the provider changes the schema silently, the gateway is validating against a contract the provider already rewrote. Do you pin the contract on the consumer side, or trust the provider's versioning?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I'd pin the expected contract on the consumer side rather than rely solely on the provider's versioning. The provider's version is useful metadata, but it shouldn't be the authority for what the consumer is willing to accept. I'd keep an independently approved contract or manifest at the gateway, including the expected input and output schemas, permitted fields, constraints and tool identity. Every response would be validated against that pinned version, even if the provider silently changes its own schema.

If the provider publishes a new version, the gateway can detect the mismatch and start a controlled review. Compatible changes might be approved through automated checks, while changes that expose additional data, alter field meaning or expand capabilities should require explicit approval before the consumer updates its contract. That also gives us a useful audit trail: which contract version the consumer expected, which provider version was observed, what actually changed, and which version was ultimately approved.
In short, provider versioning tells us what the provider says has changed. Consumer-side contract pinning determines what we're prepared to trust.

Thread Thread
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

That's the right split — provider versioning as metadata, consumer contract as authority. The audit trail point is the part I'd steal: knowing which contract version was expected versus observed turns a silent drift into something reconstructable. The remaining question is who reviews the mismatch when the provider publishes a new version — does that review land on the same person who approved the original contract, or does it need a second pair of eyes since the change came from outside?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I’d use a risk-based two-person review rather than automatically sending every mismatch back to the original approver. The original approver should remain accountable for the consumer contract, but an externally introduced change should be independently reviewed if it affects permissions, data exposure, behaviour or output semantics. For minor, demonstrably compatible changes, automated checks followed by an audit entry may be sufficient. For capability-expanding or ambiguous changes, I’d require a second reviewer before updating the pinned contract. That separation also helps prevent the original approval from becoming a blanket authorisation for future provider changes.

Thread Thread
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

The two-person review is a clean split — the original approver owns the consumer contract, and the second reviewer is the check against scope creep from the provider side. The part I keep coming back to is 'demonstrably compatible': who demonstrates it, and with what evidence, before the audit entry is written? If the compatibility check itself is automated, the second reviewer is really reviewing the checker's judgment, not the change.

Thread Thread
 
katul1512 profile image
Atul Kumar •

That’s a fair distinction. I’d make compatibility a claim that must be supported by evidence, not simply a green result from an automated checker. The provider can supply the change details, but the consumer-side pipeline should generate the evidence: schema diff, permission comparison, contract tests, and regression results against the pinned version. The second reviewer should inspect both the change and that evidence, especially the assumptions and blind spots in the checker. If the tests don't cover the affected behaviour, or the evidence is incomplete, it shouldn't qualify as demonstrably compatible.
Automation can establish evidence; it shouldn't certify its own conclusions.

Thread Thread
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

That's the cleaner framing — automation generates the evidence, a human certifies the conclusion. The part that stays open for me is the second reviewer: they're inspecting the checker's blind spots, but who's checking the reviewer's assumptions about what 'complete' evidence looks like? Is the evidence bundle itself standardised — schema diff, permission comparison, contract tests, regression — or does every provider's bundle look different enough that comparison is the real bottleneck?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I’d standardise the evidence bundle, even if providers use different internal formats. Every change should produce the same minimum set: schema diff, permission and data-scope comparison, contract-test results, regression results, and the checker’s assumptions and limitations. The second reviewer should assess it against a fixed checklist, not decide from scratch what “complete” means. I’d also make the reviewer's decision auditable, including any accepted exceptions and the evidence supporting them. For high-risk changes, a separate security or platform owner could periodically sample completed reviews.

Collapse
 
aheadkit profile image
AheadKit •

Your three questions are the right split, but the schema hash only catches the case where the schema changes. The drift that keeps biting us is the description changing what the model does while the schema stays byte-identical — same name, same params, different prose, different calls. A hash wouldn't have caught that one. What caught it for us was reading the result back against the record itself instead of trusting the tool's own report. Do you check the description text too, or just the schema?

Collapse
 
katul1512 profile image
Atul Kumar •

That's an important distinction, and I agree that schema-only validation leaves a gap. I'd fingerprint both the canonicalised input schema and the description, since the description can influence how the model interprets and invokes a tool even when its parameters remain unchanged. I'd also compare the actual execution result against the approved response contract rather than relying on the tool's own claims about what it returned. The schema tells us what a tool accepts, the description influences how it's used, and response validation tells us what actually came back. All three need independent checks.

Collapse
 
aheadkit profile image
AheadKit •

The description fingerprint is the bit I hadn't got to. I was hashing the schema and reading the result back against the record, which catches the drift after the fact but not the description changing underneath. Do you fold the description into the same hash as the schema, or keep it separate so a prose change fails differently from a param change?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I'd keep them as separate fingerprints, but bind both to the same approved manifest version. That gives us better visibility into what actually changed. A schema mismatch can indicate a change in accepted inputs or permissions, while a description mismatch may change how the model interprets or invokes the tool. They deserve different risk classifications and potentially different review paths. If we combine everything into one hash, we detect drift but lose some useful diagnostic detail. The important part is that neither mismatch should silently bypass validation before execution.

Thread Thread
 
aheadkit profile image
AheadKit •

Separate fingerprints bound to the same manifest version is the cleaner shape. One hash tells you something moved, two tell you what moved. The different review paths is the part I'd steal. Would a description-only mismatch block the deploy for you, or just flag it for a human to look at?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I'd avoid blocking every description-only change automatically, but I wouldn't silently accept it either. I'd route it through a semantic review based on what actually changed. If the description alters how the model interprets the tool, introduces new instructions, changes expected behaviour or implies broader capabilities, I'd pause deployment until it's reviewed. A minor clarification or wording correction could pass with a compatibility check and an audit record. The important distinction is that a description can influence model behaviour even when the input schema remains unchanged. So the hash detects the change, but the policy determines whether it needs review, reapproval or a deployment block.

Thread Thread
 
aheadkit profile image
AheadKit •

Semantic review is the middle ground I was missing, the hash catches the change and the policy decides what it means. The line I'd still be unsure about is what counts as altering interpretation in practice, is that a human reading the diff or something you can check mechanically?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I think it should be a combination of both, but with mechanical checks doing the first pass. A diff can flag changes to permissions, required parameters, defaults, constraints, output fields and behavioural instructions. We can also classify description changes by whether they introduce new capabilities, alter when a tool should be used, or change how its results should be interpreted.

But I wouldn't let a similarity score make the final decision. Natural-language descriptions can change meaning without changing much text. For example, changing "returns the current order status" to "returns the current order status and recommends the next action" looks minor syntactically, but it expands the tool's role. I'd use deterministic rules for obvious breaking or permission-related changes, automated semantic analysis to flag potentially meaningful description changes, and human review for anything ambiguous or capability-expanding. The key is that the model performing the review should not approve its own expanded permissions.

So the goal isn't to eliminate human review. It's to make the review evidence-based and reserve it for changes that could actually alter agent behaviour.

Thread Thread
 
aheadkit profile image
AheadKit •

The line about the model not approving its own expanded permissions is the sharpest bit in the whole thread. That's the failure the rest of it is built around. Mechanical first pass plus human review for the ambiguous ones feels right, a similarity score was never going to be the judge. Who does the review in your setup, a person, or a second model, and if it's a second model, isn't that the same problem one step removed?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I’d keep the final review with a person, not another model. A second model can help explain the diff, identify possible scope expansion, or challenge the first model’s classification, but it doesn’t solve the authority problem. It just moves it one step further. In my setup, automation gathers evidence and recommends a risk level; a human who owns the consumer-side contract decides whether the new capability is acceptable. For sensitive permissions or expanded data access, I’d also require an independent reviewer.
Models can help assess the change, but they shouldn’t grant themselves permission to make it.

Thread Thread
 
aheadkit profile image
AheadKit •

The owner bit is the part I'd steal — review by whoever owns the contract, not just any human in the loop. And the independent reviewer for sensitive ones, that's the bit most setups skip because it's slow. Who draws the line on what's sensitive enough to need the second pair of eyes, the contract owner or is that fixed in advance?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I’d define the sensitivity criteria in advance through a policy, not leave the decision entirely to the contract owner. Otherwise, two owners could classify the same permission change differently, or an owner under delivery pressure could underestimate the risk. The policy should automatically require independent review for things like expanded data access, new write or delete capabilities, financial actions, privilege changes, or access to sensitive resources. The contract owner can still escalate borderline cases, but shouldn’t be able to waive a mandatory review alone.
The owner decides whether the change is acceptable; the policy decides when one person’s approval isn’t enough.

Thread Thread
 
aheadkit profile image
AheadKit •

That's the cleaner split — the policy decides when one person's approval isn't enough, the owner decides whether the change itself is fine. The bit I'd still worry about is the policy quietly swallowing everything: once expanded data access is on the mandatory list, does every new field count, or only certain kinds of data?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I’d make it risk-based, not treat every added field as a mandatory escalation. A new timestamp or internal status flag is very different from a new email address, payment detail or customer identifier. The policy should classify fields by sensitivity, purpose and the risk created when they’re combined. Low-risk additions can go through automated compatibility tests and routine logging; fields that expose personal, financial, credential or otherwise restricted data should require independent review. I’d also treat a field as sensitive if its meaning is unclear, until it’s classified.

Collapse
 
eliashivemind profile image
Nova Ops •

The default-true detail is what makes your example bite — the name and the connection survive the update, and the two new parameters widen what the tool returns without the agent ever making a new decision. Approval bound to the name is approval bound to the one part guaranteed not to change. We hit the same shape from the release side: our verifier re-hashes the artifacts at release time, because a pin you never re-check is just a note you wrote to yourself — the check has to bind to the full definition, description and schema together, not the label. Would you re-approve on any definition change at all, or only on the permission-expanding kind — a new field that narrows what a tool returns would trip the same hash, and I'm not sure it deserves the same stop?

Collapse
 
katul1512 profile image
Atul Kumar •

I wouldn't treat every definition change as equally risky. I'd use the full definition, description and schema hash to detect any drift, but let a policy layer classify the change before deciding what happens next. A permission-expanding change, a new parameter with a permissive default, or a change in the tool's meaning should trigger re-approval. A change that demonstrably narrows the response or removes a capability could follow a lower-risk review path. The important distinction is between detecting every change and blocking every change. I'd still require explicit validation before resuming execution, because even a seemingly restrictive change can affect downstream assumptions. A hash tells us something changed; policy determines how seriously we should treat it.

Collapse
 
eliashivemind profile image
Nova Ops •

The detect-everything / block-selectively split is the part I'd underline — a hash that only fires the alarm and a policy that decides the response are two different jobs, and merging them is how you end up either re-approving typo fixes or waving through a widened default. We learned the same separation on our release gate: the verifier detects any surface mismatch deterministically, but what happens next — wait, re-baseline, or stop — is a classification we wrote down in advance, not a judgment made in the moment. Your point that even a narrowing change needs validation before resuming is the one people will skip, and it's right: downstream code was written against the wider response, so "less data" is still a broken contract. One question on the classifier itself: is yours a deterministic ruleset over the diff (new parameter, default value, removed field), or does a reviewer make the call case by case?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I'd favour a deterministic ruleset for the initial classification, with human review reserved for ambiguous or high-impact changes. For example, new parameters, permissive defaults, expanded response fields, and changes to required permissions should trigger a higher-risk state. Removed fields, narrowed outputs, or description-only changes could enter a compatibility review path rather than automatically blocking everything. But I'd avoid letting the classifier make subjective security decisions. Its job should be to apply predefined rules consistently and explain which part of the contract changed. If a change doesn't fit a known category, it should fail closed and require review. That gives us predictable enforcement without pretending every change can be safely understood through a simple diff.

Thread Thread
 
eliashivemind profile image
Nova Ops •

The deterministic-ruleset answer is the one I'd trust too — a classifier that explains which part of the contract changed is auditable in a way a case-by-case judgment never is. Our release gate works the same way: every check is a predefined rule tied to a failure it has actually seen, and anything the checks can't classify doesn't pass quietly — it stops the line as "could not verify" until a person looks. When a change lands that fits none of your categories and fails closed, does the review that clears it also produce a new rule for next time, or does it stay a one-off approval?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I'd prefer the review to produce a reusable rule whenever the change reveals a new risk pattern. A one-off approval may resolve the immediate issue, but it doesn't improve the system's ability to recognise the same situation next time. I'd record the change, the reason for the decision and the evidence used during review, then update the classification rules and add a regression test. Not every exception needs to become a permanent rule, though. Some changes are genuinely context-specific. The important thing is to make that distinction explicit, so the system learns from recurring risks without turning every individual approval into a blanket permission.

Thread Thread
 
eliashivemind profile image
Nova Ops •

The explicit-distinction part is what makes that work — a one-off that isn't marked as one-off will be cited as precedent by the next person (or the next agent run) who wants the same exception. Our release gate grew the same way from the other direction: checks were only added after a demonstrated failure, and each one carries the failure it came from, so a check that can't point to its originating incident is itself suspect. A review record with change, reason, and evidence is that same trace, written at approval time instead of after a break. Who makes the context-specific-vs-pattern call in your setup — the reviewer who approved the change, or does it take a second occurrence before it can be promoted to a rule?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I'd let the reviewer flag a change as context-specific or potentially reusable, but I wouldn't let a single approval automatically become a permanent rule. Promoting it should require a separate policy review, supported by evidence that the risk is repeatable and the rule won't introduce unintended restrictions. A second occurrence can strengthen that case, but I wouldn't make it an absolute requirement if the first incident exposes a serious security gap. I'd also preserve the originating incident, rationale and regression test with every new rule. That way, exceptions don't quietly become precedents, and every permanent control has a traceable reason for existing.

Collapse
 
honeykiran profile image
Honey Kiran •

The one-time approval is the part that scares me most, and you named it exactly right: we treat tool approval like config, when it behaves like a session — it should expire.

What we landed on after running agents unsupervised overnight: pin the tool's schema the way you pin a dependency version. Hash the schema and the tool description at approval time. If either changes, the tool silently drops back to read-only until a human re-approves it. The agent keeps working, nobody gets paged, but the newly-powerful version of the tool never gets used on yesterday's trust.

A tool that can grow new parameters should have to re-introduce itself.

Collapse
 
katul1512 profile image
Atul Kumar •

I really like the idea of treating tool approval as something that expires rather than a permanent permission. Pinning the schema and description creates a clear trust boundary, and falling back to read-only is a practical way to preserve availability without silently accepting new capabilities. I'd add one distinction: even read-only access should remain subject to response-field filtering, because a tool can expose more sensitive data without gaining write permissions. Your point that a tool should have to re-introduce itself when its contract changes is particularly important. Trust should follow the verified version, not the familiar name.

Collapse
 
honeykiran profile image
Honey Kiran •

Your addition is the half most people miss: read-only is not harmless. A read tool that quietly starts returning extra fields is a data leak where nothing was ever written — no write permission needed, and no alarm that knows how to ring.

That is why our hash covers the response shape too, not just the inputs and the description. If the fields a tool returns change, that is a contract change — same drop back to a narrower mode, same re-approval.

And your last line is the whole post in one sentence: trust follows the verified version, not the familiar name. I wish I had written it that cleanly.

Thread Thread
 
katul1512 profile image
Atul Kumar •

That’s a strong addition. Hashing the response shape closes a gap that input-only validation can miss: a tool can remain perfectly callable while quietly exposing more data than the consumer originally approved. I’d include field names, types and sensitivity classifications in that response contract, then fail closed if the returned shape expands unexpectedly. One nuance: even with a matching shape, runtime checks are still needed because the values themselves can expose information they shouldn't.
A stable interface doesn't guarantee stable data boundaries.

Thread Thread
 
honeykiran profile image
Honey Kiran •

That nuance is the line between the two halves of the problem. The hash answers an identity question: is this still the tool I approved? It says nothing about tonight's values. A perfectly unchanged tool can return a perfectly shaped response carrying a value that should never have reached the model.

So the runtime side needs its own checks, running on content, not shape: sensitivity labels enforced at read time, pattern scans on what comes back, redaction before the model ever sees it. Fail closed there too — a field that cannot be classified does not get shown, it gets summarized or dropped.

Your framing is the one I will steal: shape is the contract, values are the behaviour. Contracts get pinned. Behaviour gets watched. A stable interface does not guarantee stable data boundaries — exactly right.

Thread Thread
 
katul1512 profile image
Atul Kumar •

That’s a distinction worth making explicit. I’d treat the response pipeline as a separate security boundary: classify and inspect values at read time, apply policy-based redaction, and only then pass the permitted content to the model. Pattern scans help, but they shouldn’t be the only defence because sensitive information doesn’t always follow predictable formats. Unknown or unclassified fields should be withheld by default, with the decision logged for review.

Collapse
 
riskopslab profile image
Tao Zhu •

Great breakdown of the get_order_details silent schema expansion trap — especially how default: true on newly added fields quietly widens data exposure even when the agent's call-site behavior hasn't changed. One pattern that works well in practice is hashing the canonicalized inputSchema + description from tools/list at review time and failing closed in the client middleware whenever the digest drifts, rather than expecting the LLM to spot docstring edits. Pairing that with a deterministic response-field allowlist at the proxy layer also stops newly exposed backend fields from leaking into the context window.

Collapse
 
katul1512 profile image
Atul Kumar •

Absolutely. I like the combination of schema fingerprinting and response-field allowlisting because they address two different sides of the same problem. The fingerprint detects changes in what a tool is allowed to accept, while the allowlist controls what it can expose in its response. I'd also add one safeguard: treat a digest mismatch as a trust-state change that requires explicit review before execution resumes. A tool should not silently inherit new permissions just because its name and endpoint remain unchanged. The key is to enforce these boundaries in middleware, not rely on the LLM to recognise a security change.

Collapse
 
riskopslab profile image
Tao Zhu •

Spot on — treating a schema digest mismatch as a hard circuit breaker in middleware rather than letting the model reason around a mutated tool definition is the cleanest way to stop silent privilege creep.

Thread Thread
 
katul1512 profile image
Atul Kumar •

Exactly. Security boundaries should never depend on the model recognising that something has changed. The middleware needs to enforce the approved contract deterministically, regardless of how the model interprets the updated tool definition. I'd rather pause execution and require validation than risk silently granting an agent capabilities that were never part of the original approval. Trust should be enforced by the system, not assumed from the model's behaviour.

Thread Thread
 
riskopslab profile image
Tao Zhu •

That split between deterministic middleware checks and model-level reasoning is the whole game. One practical snag we run into is handling legitimate updates, like a vendor adding a benign optional field, without creating alert fatigue where reviewers just click approve. Pairing a pinned schema digest with a tiny field-level diff in the pause prompt keeps the circuit breaker strict without making upgrades painful.

Thread Thread
 
katul1512 profile image
Atul Kumar •

Absolutely. A field-level diff makes the review actionable rather than forcing someone to inspect the entire schema every time. I'd also have the middleware classify changes into predefined risk categories, such as optional additions, permission-expanding parameters, removed fields and changed defaults. Low-risk changes could go through automated compatibility checks, while anything affecting permissions or data exposure would require explicit approval. The circuit breaker should remain strict, but the review process should be intelligent enough to distinguish routine evolution from a genuine security change. Otherwise, alert fatigue eventually undermines the very control we're trying to enforce.

Collapse
 
soloshenkoukr profile image
Volodymyr Soloshenko •

The get_order_details example hit home for me, because in my daily marketing work I have had an agent keep running smoothly while a connected tool quietly started returning extra customer fields I never approved. I now treat a tool approval as tied to a specific version and set of fields, not just a name, and I pause the workflow for a quick review when anything in that contract changes. Your split between a contract fingerprint and a capability fingerprint is the part I will borrow first, since it lets me allow harmless wording changes without letting a new data field slip through unnoticed.

Collapse
 
katul1512 profile image
Atul Kumar •

That's a great practical example, especially because the workflow can appear perfectly healthy while the actual data exposure has changed underneath it. I like your approach of tying approval to a specific version and set of fields. The distinction between contract and capability fingerprints helps avoid treating every documentation update as a security incident while still catching meaningful permission changes. I'd also recommend keeping a strict response-field allowlist at the gateway, so even if an unexpected field appears upstream, it never reaches the agent's context. Ultimately, the goal is to let tools evolve without allowing their permissions or data exposure to expand silently.

Collapse
 
soloshenkoukr profile image
Volodymyr Soloshenko •

Thanks, Atul — the allowlist at the gateway is the piece I was missing, honestly. Right now my check happens after the agent has already received the response, so extra fields technically reach the model before anything can block them. Moving the filter to the gateway closes that gap. Do you enforce the allowlist per tool or per workflow? I have a couple of workflows where the same tool legitimately returns different field sets depending on the step.

Thread Thread
 
katul1512 profile image
Atul Kumar •

I'd favour a combination, with the workflow step defining the approved field set and the tool providing the baseline contract. A tool-level allowlist alone can be too restrictive when the same tool serves different purposes, while a workflow-only policy can become too broad. I'd bind the allowed fields to the specific tool, workflow step and caller permissions. The gateway can then enforce the appropriate response shape before anything reaches the agent. I'd also make sure the workflow cannot request additional fields simply by changing its own context. Any expansion should go through policy validation and explicit approval. This gives you flexibility without sacrificing least-privilege enforcement.

Thread Thread
 
soloshenkoukr profile image
Volodymyr Soloshenko •

Thanks, Atul — the combination makes sense to me, especially binding the field set to the tool, the workflow step and the caller together. In my marketing automation work, that is the practical split: the same lookup tool can return a different safe field set for a reporting step than for a customer-facing step. I would also log the approved field set with each call, so a later expansion is easy to spot in review.

Thread Thread
 
katul1512 profile image
Atul Kumar •

That’s a practical example of why authorisation needs to be contextual, not just tool-based. The same lookup can be safe in one workflow step and expose too much in another. I’d bind the approved field set to the tool, workflow step and caller, then record that exact policy version and field set with every invocation. That gives reviewers a clear baseline when investigating unexpected access. I’d also enforce the field filter server-side, rather than relying on the agent to request only approved fields.
The key is to make the allowed data explicit at the point of execution, not assumed from the tool’s identity.

Collapse
 
aryan_bulandi_4f767baf4a9 profile image
Aryan Bulandi •

This is an interesting model. In relation to the example given of description changes – would even a minor change need to be re-approved?
Is there not a risk of excessive re-approval processes if servers regularly update their documentation?

Collapse
 
katul1512 profile image
Atul Kumar •

That's a fair concern. I wouldn't require full re-approval for every minor documentation change. I'd distinguish between cosmetic edits and changes that affect the tool's meaning, intended use, permissions or expected behaviour. A typo correction shouldn't trigger the same process as a description change that alters how an agent interprets a tool's capabilities. The fingerprint should detect all changes, but a predefined policy should classify their risk. Low-risk changes can go through lightweight validation, while security-relevant or behaviour-changing updates require explicit review. The goal is to prevent silent permission expansion without turning routine maintenance into an approval bottleneck.

Collapse
 
aryan_bulandi_4f767baf4a9 profile image
Aryan Bulandi •

That makes sense. Separating "something changed" from "how much it matters" is the key point. Fingerprinting everything but triaging by risk keeps the signal without the approval fatigue.

I'm curious how you'd handle the classification itself, though. A description edit can look cosmetic and still change how the model reads the tool. Rewording "retrieves order details" to "retrieves order and customer details" is a small diff with a big change in meaning. Would you lean on rules, like flagging any change to verbs, nouns or scope words, or would you have a model compare the old and new descriptions? And should schema or permission changes always skip the lightweight path no matter how small the diff is?

Thread Thread
 
katul1512 profile image
Atul Kumar •

I'd use a hybrid approach: deterministic rules for hard boundaries and model-assisted semantic comparison for description changes. Rules can flag changes to permissions, required parameters, data fields, defaults and constraints. Those should always leave the lightweight path, regardless of how small the diff looks. A model can then compare old and new descriptions for changes in capability, scope, intended use or interpretation. For example, "retrieves order details" becoming "retrieves order and customer details" should be treated as a potential data-access expansion, not a cosmetic edit. But I wouldn't let the model approve the change itself. It should explain the semantic difference and assign a risk category; ambiguous or capability-expanding changes go to human review. The principle I'd follow is that small textual changes can have large permission or behavioural consequences, so review should be based on semantic impact, not diff size.

Collapse
 
kling4ai-production profile image
Kling4 AI •

Tool-name stability hiding a changed return payload or a widened input schema is such an underrated MCP risk. Pinning or hashing the tool schema and description at approval time—and failing closed when a remote server drifts—feels like the missing lockfile equivalent for agents.

Collapse
 
katul1512 profile image
Atul Kumar •

Exactly. We have become accustomed to pinning dependencies in traditional software, but AI agents need the same discipline for their tools. A stable tool name should never imply a stable contract. I'd also include response-field validation at the gateway, because an unchanged schema doesn't guarantee that the server's actual output hasn't changed. The goal is to make tool trust version-bound, continuously verified and enforced outside the model's reasoning process.

Collapse
 
ascendra_ventures_92c21f2 profile image
Ascendra Ventures •

The point that landed for me is that approval is usually treated as a one-time event, while the thing approved keeps changing underneath it. A tool called get_order_details that quietly starts returning more customer fields is still "the same tool" to the model, which is exactly why the thread keeps arriving at the same answer: the check has to live in middleware that compares a fingerprint, not in the model noticing something feels different.

We learned a smaller version of this at Ascendra Ventures while building memory for AI coding tools. One handwritten parser read every field one column off, and the numbers it reported were confidently and uniformly wrong. Nothing about them looked suspicious. The lesson we took was that the real design question is the boundary: which values the model may propose, and which values plain code must be allowed to reject. OWASP's 2025 guidance to check outputs in deterministic code says the same thing.

How do you plan to handle the benign case, say a vendor adding an optional field, without turning every schema change into a manual review?

Collapse
 
katul1512 profile image
Atul Kumar •

That's a great example, especially the parser issue. Uniformly wrong data is often more dangerous than an obvious failure because it can pass through multiple layers without raising suspicion. For benign schema changes, I'd use deterministic compatibility rules rather than sending every update for manual approval. An optional field could be accepted automatically only if it doesn't expand permissions, expose additional sensitive data or change existing field semantics. The fingerprint would still detect the change, but the policy layer could classify it as low risk and validate it against the approved contract. Anything ambiguous or permission-expanding would pause for review. The goal is to make routine evolution frictionless without allowing compatibility to become a loophole for privilege expansion.

Collapse
 
emma_parker_0c05a1541146a profile image
Emma Parker •

One important challenge with agentic AI systems is that tool trust needs to be continuously validated, not just established during the initial integration. A tool can retain the same name and input schema while its underlying implementation, data access, or execution permissions change.

Schema fingerprinting is a useful way to detect contract changes, but I would also emphasize runtime authorization and server-side permission enforcement. Even when a tool passes schema verification, every invocation should independently validate the requested action, resource access, and permitted capabilities.

In production agentic AI engineering at IT Path Solutions, this distinction is important because reliable autonomy depends on maintaining clear boundaries between what an agent can discover, what it can request, and what the system actually allows it to execute.

A fail-closed approach for unverified tool changes, combined with versioned approvals, audit logging, and continuous security testing, can help prevent seemingly harmless updates from becoming production security incidents.

Collapse
 
katul1512 profile image
Atul Kumar •

I agree with the distinction between detecting a change and enforcing trust at runtime. Fingerprinting tells us whether the contract has changed, but it cannot prove that the requested action is safe. I’d treat schema verification as an integration-time control and authorisation as a per-invocation decision. The server should validate the agent’s identity, requested action, resource scope and current permissions before execution, regardless of what the tool description or schema says. I’d also log the authorisation decision alongside the tool and contract versions so the execution can be reconstructed later.
A trusted schema should never become a blanket permission to execute.