Rewriting the Test Boundary for AI Agent Systems

    As AI systems evolve from single-shot models into long-running, stateful agents that call tools and act on real environments, traditional evaluation assumptions break down. This article explains why the test boundary must shift from single-output correctness to the controllability, recoverability, and auditability of long-term behavior. It covers four emerging challenges—restricted canary releases, persistent state poisoning, error accumulation in long tasks, and on-device inference—and proposes a five-dimension test boundary spanning state, tools, time, environment, and data, along with a practical layered testing approach.

    1. The Shift Has Already Happened: From Testing a Model to Testing a System

    In the past, evaluating an AI capability meant feeding in a batch of prompts and comparing the outputs. But once a system starts running over long periods, saving state, calling tools, and acting on a real environment, the basic assumptions behind testing fall apart. Output is no longer a one-off result; it is a trajectory shaped jointly by historical state, tool return values, and external side effects. The test boundary therefore needs to be rewritten: away from “single-point output correctness” and toward the controllability, recoverability, and auditability of long-cycle behavior.

    This shift breaks down into four main threads: new capabilities first enter a restricted canary environment rather than being released publicly; persistent state becomes a new attack surface; continuous execution of long tasks amplifies error accumulation; and inference moving down to the edge extends the test environment from the cloud to heterogeneous devices.

    2. New Testing Problems from the Four Threads

    2.1 Restricted Canary: Turning “Release” into an “Observable Experiment”

    Trying out a new capability within a controlled scope is essentially turning a release into an experiment. Testing work therefore moves earlier: you need to define clear admission metrics, exit conditions, and rollback switches for the canary, and to keep full-chain traces of canary traffic. The key question is not “does it work,” but “when something goes wrong, can we locate and stop the loss within minutes.”

    2.2 Persistent State Poisoning: Why Success Rates Climb Sharply

    Industry research generally shows that poisoning attacks targeting persistent state can achieve success rates above 60%. The reason is that an attacker does not need to fool the model every time; they only need to write a “memory” or configuration in a single round that is reused over the long term, after which every subsequent session keeps amplifying that piece of false information. These attacks share three traits: low trigger cost, long incubation, and cross-session propagation. Traditional one-off evaluation can hardly cover them.

    2.3 Continuous Long-Task Execution: Error Accumulation and “Silent Failure”

    Once continuous execution of long tasks is emphasized, a high per-step accuracy is no longer enough. If each step deviates by a few percent, the task will most likely drift off target after dozens of steps. More dangerous is silent failure: the process keeps moving forward and logs keep being emitted, but the goal has long since gone off course, and it is only discovered after real side effects occur.

    2.4 On-Device Inference: The Test Matrix Goes from “One Cloud” to “A Pile of Devices”

    After inference frameworks move down to the terminal, model size, quantization scheme, operator support, and memory and power constraints all affect result consistency. The same version may produce output drift across different chips and system versions, so testing must cover the device matrix, offline scenarios, and weak-network reconnection.

    3. The Rewritten Test Boundary: Five Dimensions

    • State boundary: distinguish temporary in-session state from persistent cross-session state, and clarify what content can be written, by whom, and for how long it is retained.
    • Tool boundary: define the permission scope, call quota, list of writable resources, and the manual-confirmation threshold for high-risk operations for each tool.
    • Time boundary: extend from “single-request latency” to “long-task success rate, average number of steps to completion, and timeout and interruption recovery rate.”
    • Environment boundary: unify version definitions across cloud and edge, and build a verification checklist for the device matrix and degradation strategies.
    • Data boundary: manage training, evaluation, and online feedback data in separate domains to prevent the evaluation set from being contaminated and inflating metrics.

    4. A Practical Layered Testing Approach

    Layer one, unit and contract testing: verify the input/output contracts of tool interfaces, error codes, and idempotency, ensuring that repeated calls do not produce duplicate side effects.

    Layer two, state security testing: simulate malicious writes, unauthorized writes, and expired-but-uncleaned data to verify whether write validation and isolation take effect.

    1. # Example: source and trust validation before a persistent write
    2. def guard_write(state, item, source):
    3. if source not in TRUSTED_SOURCES:
    4. raise PermissionError("untrusted source")
    5. if not item.schema_valid():
    6. raise ValueError("invalid schema")
    7. if state.recently_seen(item.fingerprint):
    8. return # idempotently drop to avoid repeated poisoning
    9. state.append(item, ttl=item.ttl)

    Layer three, long-task regression: use a fixed task set to measure continuous-execution success rate and average number of steps, and set a rollback checkpoint at each step.

    Layer four, on-device consistency: compare key outputs across devices under the same version, and record the range of drift caused by quantization and operator differences.

    Layer five, online observation and drills: build a metrics dashboard and alert thresholds, and regularly run fault injection and rollback drills, treating “can we stop the loss” as an acceptance criterion.

    5. Engineering Support: Making Test Conclusions Trustworthy

    Trustworthy metrics depend on trustworthy data. It is advisable to combine common capabilities such as logging services, monitoring and alerting, object storage, and message queues into a closed loop: full-chain traces are written to object storage, key events are aggregated asynchronously through a message queue, and anomalies are triggered by monitoring alerts. Baidu AI Cloud typically provides standardized access methods for these common categories, making it easier for teams to string the evaluation pipeline, canary switches, and rollback actions into a single auditable chain without building the entire infrastructure themselves.

    6. Conclusion

    Rewriting the test boundary is essentially changing the acceptance standard from “is the answer correct” to “does it run stably, is failure controllable, and is recovery timely.” Once a system starts running with state over the long term, whoever establishes protection and verification across the five dimensions of state, tools, time, environment, and data earlier can keep the risks of new capabilities within a tolerable range.