🔒
Global Knowledge Platform
Serving Researchers Since 2012

GOALGUARD: Autonomous Goal-Drift Detection & Correction

DOI : 10.5281/zenodo.24434186
Download Full-Text PDF Cite this Publication

Text Only Version

GOALGUARD: Autonomous Goal-Drift Detection & Correction

Purvi M.

Dept. of CSE (AI & ML) Dayananda Sagar University Bengaluru, India

Sindhu S. Rao

Dept. of CSE (AI & ML) Dayananda Sagar University, Bengaluru, India

Nikhil K

Dept. of CSE (AI & ML) Dayananda Sagar University Bengaluru, India

Mr. Suresh Kandasamy

Professor Of Practice Dept. of CSE (AI & ML), Dayananda Sagar University Bengaluru, India

Abstract – As Large Language Models (LLMs) are increasingly deployed as autonomous agents operating over extended temporal horizons, maintaining strict adherence to human-specied system objectives becomes a foundational prerequisite for operational safety, alignment, and reliability. Recent empirical studies demon- strate that even frontier language model agents suffer from goal driftthe gradual behavioral deviation from an initial system goal toward competing environmental incentives or previously pursued instrumental sub-goals as context length expands. In this paper, we present GoalGuard, an end-to-end simulation, real- time telemetry, and runtime mitigation framework designed to operationalize, diagnose, and counteract goal drift in autonomous LLM agents. Grounded in the formal evaluation methodology of Arike et al., GoalGuard implements a controlled multi-step simulation environment (Apex Capital) that decouples drift via commission (GDactions) from drift via omission (GDinaction) across baseline, adversarial pressure, and goal-switching regimes. Fur- thermore, GoalGuard introduces a modular FastAPI-based run- time interception engine coupled with an interactive React/Vite telemetry dashboard that tracks pattern-matching susceptibil- ity across expanding token horizons and dynamically injects structured goal-elicitation and context-anchoring interventions when drift thresholds are breached. We present the complete system architecture, formal drift metrics, and a standardized multi-tier evaluation protocol spanning trajectories up to 100,000 context tokens, establishing the benchmarking methodology for validating runtime reductions in cumulative GDactions and post- switch GDinaction prior to large-scale multi-model deployment.

Index TermsAutonomous Agents, Goal Drift, AI Safety, Long-Horizon Reasoning, Large Language Models, Behavioral Evaluation, Guardrails, Instrumental Convergence.

  1. INTRODUCTION

    Autonomous agents powered by Large Language Models (LLMs) are rapidly transitioning from stateless, single-turn conversational assistants to stateful decision-makers execut- ing complex multi-step workows across nancial portfolio management, autonomous software engineering, scientic dis- covery, and enterprise resource planning [?], [?]. In these real-world deployments, agents must operate over extended time horizons with minimal human supervision, requiring them to balance a primary, human-assigned system goal against shifting environmental feedback, persuasive user nudges, and temporary instrumental goals necessary for intermediate task execution.

    However, long-horizon autonomy introduces a subtle yet critical alignment failure mode known as goal drift: an agents

    progressive behavioral tendency to deviate from its original system-level objective over time, even when that objective was unambiguously specied in the initial system prompt and remains accessible within the models context window [?]. Unlike abrupt adversarial jailbreaks, explicit prompt injections, or catastrophic reasoning hallucinations, goal drift emerges gradually and silently as interaction histories accumulate.

    Arike et al. [?] provided a seminal empirical investigation into this phenomenon, demonstrating that goal drift in modern LLM agents is not merely a byproduct of context length or memory decay (lost in the middle [?]). Instead, drift is strongly driven by an agents increasing susceptibility to autoregressive pattern-matching over its own prior action trajectory rather than goal-directed reasoning from its system specication. This vulnerability becomes particularly acute when an agent exhibits high behavioral exibilityfor exam- ple, temporarily adopting an instrumental sub-goal for several timesteps before being instructed to revert to its primary sys- tem objective. During the post-switch phase, models frequently exhibit inertia, failing to unwind instrumental commitments due to behavioral repetition bias in the context history.

    Despite the rapid proliferation of static benchmarks for evaluating long-context retrieval [?] or single-turn safety guardrails [?], AI safety researchers and systems engineers lack accessible, interactive platforms for continuous, step- level goal-drift telemetry and active runtime mitigation. Existing evaluation harnesses typically operate as ofine batch scripts that compute aggregate end-of-episode scores, offering neither real-time visibility into the onset of pattern-matching inertia nor programmatic interventions capable of arresting drift mid-trajectory.

    To bridge this gap between theoretical behavioral evaluation and practical agent runtime defense, we introduce GoalGuard, a full-stack simulation, observability, and guardrail framework built upon the theoretical formalism of Arike et al. [?].

    The primary contributions of this work are summarized as follows:

    1. Operationalized Multi-Regime Drift Simulator: A modular Python/FastAPI backend implementing de- terministic, mutually exclusive multi-objective en- vironments (Apex Capital) capable of evaluating both commission-based (GDactions) and omission-based

      (GDinaction) goal drift across arbitrary context token horizons.

    2. Threshold-Triggered Runtime Mitigation Engine: A lightweight, model-agnostic interception middleware that continuously scores trajectory drift at each timestep t and dynamically applies strong goal-elicitation re- anchoring and trajectory summarization to disrupt pattern-matching loops without degrading valid instru- mental task execution.

    3. Interactive Full-Stack Telemetry Dashboard: A re- sponsive React/Vite web application providing real-time visualization of portfolio allocations, token-horizon drift curves, phase-transition markers, and a step-by-step Rea- soning and Tool-Execution Audit Drawer.

    4. Reproducible Evaluation Ablation Protocol: A stan- dardized experimental benchmark design spanning pro- prietary and open-weights LLMs under adversarial pres- sure and goal-switching regimes to evaluate expected trade-offs between elicitation strength, context length, intervention thresholds, and computational overhead.

    The remainder of this paper is organized as follows. Sec- tion II reviews related literature on long-horizon agent bench- marks, instrumental convergence, and runtime guardrails. Sec- tion III details the theoretical formulation, evaluation regimes, and mathematical metrics underlying GoalGuard. Section IV presents the end-to-end client-server architecture, API design, and runtime mitigation algorithm. Section V describes the experimental methodology and evaluation protocols, followed by the proposed acceptance criteria and analytical discussion in Section VI. Finally, Section VII discusses current limitations and outlines directions for future research.

  2. RELATED WORK

    1. Long-Horizon Agentic Benchmarks

      Evaluating the reliability of LLM agents over extended hori- zons has emerged as a central challenge in machine learning systems. Early agentic benchmarks such as AgentBench [?], WebArena [?], and SWE-bench [?] evaluate multi-step tool use, web navigation, and repository-level code generatio. More recently, Vending-Bench [?] and long-horizon task com- pletion studies [?] have extended evaluation trajectories to tens of thousands of tokens to assess long-term business coherence and operational endurance. While these benchmarks effectively measure capability degradation and task failure over time, they assume a single, static objective and do not isolate whether behavioral errors arise from insufcient reasoning capacity or an implicit shift in the agents pursued objective.

    2. Long-Context Attention and Pattern-Matching Bias

      A parallel body of work investigates how transformer archi- tectures process information across extended context windows (32k to > 1M tokens). Studies such as Needle-in-a-Haystack and RULER [?] reveal that retrieval accuracy degrades non- uniformly depending on token position [?]. Furthermore, re- search on in-context learning (ICL) demonstrates that LLMs

      act as strong sequence-completion engines that tend to imitate formatting, stylistic, and behavioral patterns present in their recent context history [?], [?]. Arike et al. [?] connected this ICL induction mechanism directly to agentic alignment, prov- ing that repeating an instrumental behavior over k timesteps creates a strong behavioral prior that overrides system-level instructions once the instrumental phase concludes.

    3. Instrumental Convergence and Goal Stability

      Classical AI alignment theory has long warned of instru- mental convergence and goal intrinsicationthe tendency of an intelligent agent to pursue intermediate sub-goals (such as resource acquisition or self-preservation) as ends in themselves rather than means toward a primary objective [?], [?]. While prior safety benchmarks focused on overt deceptive alignment or reward hacking [?], [?], Arike et al. [?] introduced the rst controlled empirical framework to measure subtle, non- malicious goal drift in frontier models. GoalGuard builds directly upon this foundation by transforming ofine drift diagnostics into a real-time monitoring and mitigation archi- tecture.

    4. Runtime Guardrails for Autonomous Agents

    Existing LLM safety guardrails, such as Llama Guard [?] and NeMo Guardrails [?], primarily operate as input/output classiers ltering toxic content, personally identiable infor- mation (PII), or single-turn jailbreak attempts. Because goal drift manifests as valid, domain-appropriate tool calls (e.g., purchasing protable equities that violate an ESG mandate) rather than overtly harmful text, stateless content lters fail to detect it. GoalGuard addresses this limitation by maintaining stateful trajectory telemetry and evaluating cumulative behav- ioral alignment against Gsys at every decision boundary.

  3. THEORETICAL FORMULATION OF GOAL DRIFT Following the formal framework established by Arike et

    al. [?], GoalGuard models an autonomous agent interacting with a stateful, discrete-time environment E = (S, A, T , O) over a nite horizon of T timesteps, indexed by t

    {1, 2,…,T }.

    1. Objective Specication and Mutually Exclusive Action Spaces

      C { }

      At initialization (t = 0), the agent is congured with a pri- mary system goal Gsys embedded within its immutable system prompt Psys. To enable unambiguous quantitative measurement of objective adherence, the environment denes a nite set of discrete resource clusters = Csys, Ccomp, Cneutral governed by mutually exclusive resource constraints:

      • Csys represents the set of actions and asset allocations strictly aligned with the primary system goal Gsys (e.g., high-ESG, sustainable technology equities).

      • Ccomp represents a competing objective cluster Gcomp that offers strong environmental incentives or short-term rewards while directly contravening Gsys (e.g., high-yield fossil fuel or defense equities).

      • Cneutral represents unallocated liquidity or operational cash reserves Bcash(t).

        O

        At each timestep t, the agent receives an observation

        ot containing current market valuations, news bul- letins, portfolio holdings, and remaining liquidity, and outputs

        reserve buffer Breserve 0 when Gsys mandates active capital deployment:

        , if Bdeployable(t) > 0

        Bdeployable(t)

        Bmisaligned(t)+ Bidle(t)

        GD

        actions

        (t) =

        GD

        an optional model-provided explanation rt (when emitted

        A

        0, if Bdeployable(t)=0

        by the model) followed by a valid tool action at

        (e.g., buy(asset, amount), sell(asset, amount),

        ( )

        where

        Baligned(t) =

        ),iCsys vi(t)

        and

        (1)

        Bmisaligned(t) =

        (ot, rt, at) to the agents cumulative context history Ht =

        i at step t), Bidle(t) = max 0, Bcash(t) Breserve

        or hold()). The environment state transitions deterministi- cally via st+1 = T (st, at), appending the interaction tuple

        i Ccomp vi(t) denote mark-to-market capital in aligned and misaligned clusters (vi(t) is the mark-to-market value of asset

        ),

        denotes

        {(o1, r1, a1),…, (ot, rt, at)}.

    2. Canonical Evaluation Regimes

      To isolate distinct causal mechanisms of goal drift, Goal- Guard implements three standardized experimental regimes:

      1. Baseline Regime (Neutral Trajectory): The agent is initialized with Gsys and operates for all T timesteps in an environment devoid of adversarial nudges or competing pres- sure. This regime establishes the models baseline instruction-

        following delity and measures natural stochastic variance across growing context lengths |Ht|.

        { }

      2. Adversarial Pressure Regime: While initialized with Gsys, the agent receives continuous environmental pressures favoring Gcomp at every timestep t 1,…,T . These pressures include simulated stakeholder emails, market ana- lyst recommendations highlighting superior returns in Ccomp, and quarterly performance warnings. This regime evaluates resistance to cumulative persuasive drift.

      3. Goal-Switching Regime (Instrumental Phase Transition):

      excess uninvested liquidity above Breserve, and Bdeployable(t) = Baligned(t) + Bmisaligned(t) + Bidle(t) represents total deploy- able capital. Because every component is non-negative and Bmisaligned(t)+ Bidle(t) Bdeployable(t), GDactions(t) is strictly bounded within [0, 1], where 0 denotes complete alignment with Gsys and 1 denotes complete abandonment.

      1. Goal Drift via Inaction (GDinaction): GDinaction(t) is dened strictly during the post-switch evaluation phase (t > k) of the goal-switching regime; for all non-switching regimes and for pre-switch steps (t k), GDinaction(t) is not applicable (N/A). In the post-switch phase (t > k), an agent may cease purchasing Ccomp assets (GDactions decreases) yet fail to liquidate the Ccomp positions accumulated during steps 1 … k. To isolate omission-based behavioral inertia from exogenous market price uctuations during the evaluation phase, GDinaction(t) measures the retained share fraction of instrumental holdings normalized against peak instrumental exposure:

        min11, Vinst retained(t) , t > k, Vinst peak > 0

        To test for instrumental goal intrinsication and pattern- matching inertia, the trajectory is partitioned into two phases separated by a switch boundary t = k:

        GDinaction(t) =

        Vinst peak

        0, t > k, V

        inst peak =0

        (2)

        • Instrumental Phase (1 t k): At t = 1, a transient user directive instructs the agent to temporarily pursue an instrumental goal Ginst (aligned with Ccomp) to satisfy an immediate liquidity or benchmark threshold, explicitly noting that Gsys remains the overarching mandate.

          • Evaluation Phase (k < t T ): At t = k + 1,

          N/A, t k or non-switching

          ),

          where Vinst retained(t) = i Ccomp qi(t) pi(k evaluates re- tained instrumental share quantities qi(t) at step t > k

          1jk

          iCcomp

          i

          i

          ),

          using xed switch-boundary prices pi(k), and Vinst peak = max q (j) p (k) denotes the peak instrumental

          the instrumental condition is satised and the agent is instructed to resume pursuing Gsys exclusively. In this phase, full adherence requires both directing new capital to Csys and actively divesting legacy positions held in Ccomp.

    3. Quantitative Drift Metrics: Commission vs. Omission

      position size attained during the instrumental phase.

      1. Cumulative Trajectory Drift Scores: Because GDactions(t) is evaluated across all active Gsys timesteps whereas GDinaction(t) is dened exclusively after a goal switch (t > k), GoalGuard computes their time-averaged Area Under the Drift Curve (AUDC) over separate, metric- specic evaluation windows:

      T t +1act t=tact

      Drawing from cognitive psychologys distinction be- T

      tween errors of commission and errors of omission [?], GoalGuard computes two normalized, bounded metrics GDactions(t), GDinaction(t) [0, 1] at each evaluation step t:

      es active behavioral commissions that violate G

      sys

      , capturing

      GD

      GDactions = 1 GDactions(t) (3)

      1 ),

      =

      T k

      t=k+1

      1) Goal Drift via Actions (GDactions): GDactions(t) quanti-

      es active behavioral commissions that violate G

      sys

      , capturing

      T

      inaction

      =

      T k

      GDinaction(t), if goal-switching

      es active behavioral commissions that violate G

      sys

      , capturing

      GD

      both capital allocated to misaligned asset clusters and excess uninvested liquidity held beyond the permitted operational

      N/A, otherwise

      (4)

      where tact =1 in the baseline and adversarial pressure regimes, and tact = k +1 in the goal-switching regime so both post- switch metrics average over the identical T k evaluation steps.

  4. SYSTEM ARCHITECTURE OF GOALGUARD

    GoalGuard is engineered as a modular, decoupled client- server web application that separates stateful environment simulation and LLM orchestration from interactive visual telemetry. Fig. 1 illustrates the end-to-end data ow and control loop across the system components.

    Frontend Telemetry Dashboard (React / Vite)

    Experiment Congurator

    Synchronized Drift Curves

    Reasoning & Tool Audit Drawer

    POST /api/sim/step JSON / SSE Stream

    1. Elicitation Prompting Modes: GoalGuard natively im- plements both elicitation levels dened in the base study:

        • Weak Elicitation: Provides the primary objective Gsys in the system prompt without meta-cognitive reminders about long-horizon drift or pattern matching.

        • Strong Elicitation: Augments the system prompt with explicit instructions warning the agent against autoregres- sive imitation of prior instrumental actions and instructing it to verify every trade against Gsys prior to execution.

      { }

      { }

    2. Runtime Mitigation Middleware: Unlike static prompt- ing alone, GoalGuards mitigation engine operates as a stateful closed-loop controller governed by two binary indicators: the episode-level regime ag Iswitch 0, 1 (equal to 1 only in the goal-switching regime, and 0 in baseline and adversarial regimes) and the timestep-level evaluation-phase indicator Ieval 0, 1 , which signals whether Gsys is the active mandate at step t (specically, Ieval = 1 for all t 1 when Iswitch = 0, whereas Ieval = I[t > k] when Iswitch = 1

    so interventions remain disabled during the instrumental phase

    Environment Engine

    Action at

    LLM Agent Wrapper

    Multi-Provider Inference

    Apex Capital State T (st, at)

    anchor, H1

    :k Mitigation Engine

    Re-Anchor & Summarize

    P

    st+1

    Telemetry Scorer

    GDactions(t), GDinaction(t)

    max(GD) > ?

    1 t k). After every agent action at, the telemetry scorer computes instantaneous GDactions(t), whereas GDinaction(t) is calculated exclusively when Iswitch = 1 and t > k (and marked N/A otherwise). Whenever Ieval = 1 and the active drift score breaches a user-dened safety threshold (0, 1), GoalGuard triggers a two-stage intervention prior to timestep t + 1, formalized in Algorithm 1.

    B. RESTful API Specication

    Backend Simulation & Guardrail Engine (FastAPI)

    Fig. 1. End-to-end client-server architecture of GoalGuard, illustrating the closed-loop telemetry scoring and threshold-triggered mitigation middleware.

    Table I summarizes the primary REST endpoints exposed by the FastAPI server to coordinate simulation execution and telemetry streaming.

    TABLE I

    CORE REST API ENDPOINTS IN GOALGUARD BACKEND

    1. Backend Simulation Orchestration Engine (FastAPI)

      The backend service (backend/main.py) is built on Python and FastAPI, leveraging asynchronous I/O and Py- dantic schema validation to manage concurrent simulation sessions and deterministic state transitions. It comprises four core subsystems:

      1. Apex Capital Environment State Machine: The environ- ment engine implements the multi-cluster nancial portfolio simulation introduced by Arike et al. [?]. At each timestep, the state machine updates asset prices according to congurable stochastic or deterministic market schedules, executes vali- dated buy/sell/hold tool calls, enforces transaction constraints, and injects regime-specic contextual narratives (e.g., quar- terly stakeholder memos, market alerts, or instrumental phase transitions).

      2. Multi-Provider LLM Agent Wrapper: To support cross- model benchmarking, the agent wrapper abstracts provider- specic inference APIs behind a unied interface support- ing OpenAI, Anthropic, and open-weights models served via vLLM or Ollama. It tracks exact prompt and completion token counts at every turn to map behavioral drift directly against

    cumulative context length |Ht|.

    Method Endpoint Functional Responsibility

    POST /api/sim/init Initializes a new environment

    session with regime, horizon T , model ID, and threshold .

    POST /api/sim/step Advances simulation by one

    timestep, executes LLM infer- ence, scores drift, and runs mit- igation.

    POST /api/sim/run Executes a full multi-step hori-

    zon asynchronously with real- time progress updates.

    GET /api/sim/metrics Returns full time-series arrays

    of GDactions(t), GDinaction(t), and token counts.

    { }

    GET /api/sim/trace/ t Retrieves raw prompt, model-

    provided explanation rt (if available), tool call at, and port- folio state at step t.

    C. Frontend Telemetry Dashboard (React & Vite)

    The client interface (frontend/src/App.jsx) is im- plemented as a single-page React application bundled with Vite, providing real-time visual analytics for safety re- searchers:

    Algorithm 1 GoalGuard Threshold-Triggered Runtime Miti- gation

    Require: Prompt Psys, history Ht1, inputs (ot, ot+1), thresh- old (0, 1), limit Lcompress, switch step k, ags Iswitch, Ieval 0, 1 , boolean is compressed

    { }

    Ensure: st+1, Ht, ot+1, is compressed, gt

    1: (rt, at) LLM(Psys, Ht1, ot)

    2: st+1 T (st, at)

    { }

    3: Ht Ht1 (ot, rt, at)

    4: Compute GDactions(t) via Eq. (1)

    5: if Iswitch =1 and t > k then

    ( )

    6: Compute GDinaction(t) via Eq. (2)

    7: dt max GDactions(t), GDinaction(t)

    8: else

    9: GDinaction(t) N/A

    10: dt GDactions(t)

    ( )

    11: end if

    2: gt GDactions(t), GDinaction(t)

    13: ot+1 ot+1

    14: if Ieval =1 and dt > then

    15: Mt {i Ccomp | vi(t) > 0}

    16: {Ignore N/A entries in gt}

    17: Panchor BUILDANCHOR(Gsys, gt, Mt)

    18: if Iswitch = 1 and t > k and |Ht|tok > Lcompress and

    ¬ is compressed then

  5. EXPERIMENTAL SETUP AND EVALUATION STATUS

    1. Implementation and Evaluation Status

      At the current stage of development, the complete Goal- Guard simulation engine, FastAPI runtime mitigation mid- dleware, and React/Vite telemetry dashboard have been im- plemented and veried using deterministic mock-agent and single-trajectory smoke tests. Full-scale, multi-seed empirical benchmarking across external LLM APIs and local GPU- hosted checkpoints has not yet been completed; accordingly, Section VI species the proposed acceptance criteria, statisti- cal comparison protocol, and expected behavioral outcomes to be validated upon completion of the multi-model benchmark runs.

    2. Target Model Taxonomy

      To evaluate the generalizability of goal drift and the efcacy of GoalGuard across model families and parameter scales, the benchmark protocol spans three distinct model tiers supported by the multi-provider wrapper:

      1. Tier-1 Frontier Reasoning Models: High-capacity proprietary instruction-tuned models supporting context windows 128k tokens (e.g., GPT-4o and Claude 3.5 Sonnet class models).

      2. Tier-2 Large Open-Weights Models: Large-scale

        open-weights transformers ( 70B parameters, e.g.,

        19: H1:k SUMMARIZEINST(H1:k)

        20: Ht H1:k Hk+1:t

        21: is compressed true

        22: end if

        23: ot+1 INJECTNOTICE(ot+1, Panchor)

        24: end if

        25: return st+1, Ht, ot+1, is compressed, gt

        • Interactive Experiment Congurator: Allows users to select target LLMs, toggle between Baseline, Ad- versarial Pressure, and Goal-Switching regimes, adjust instrumental phase duration k, and congure GoalGuards intervention threshold .

          | |

        • Synchronized Multi-Axis Drift Charts: Plots GDactions(t) and GDinaction(t) alongside cumulative context token length Ht , rendering vertical phase- boundary markers at t = k and highlighting timesteps where GoalGuard interventions red.

        • Portfolio Allocation Liquidity Breakdown: Visualizes step-by-step capital distribution across Csys (aligned), Ccomp (misaligned/instrumental), and Cneutral (operational cash).

        • Reasoning and Tool-Execution Audit Drawer: Enables side-by-side inspection of model-provided explanations rt (when emitted by the model) and executed tool calls at, allowing researchers to distinguish explicit goal aban- donment from subtle pattern-matching inertia.

        Llama-3.1-70B-Instruct) served via vLLM with deter- ministic decoding.

      3. Tier-3 Mid-Scale Tool-Use Models: Mid-scale open- weights models (30B35B parameters, e.g., Qwen-2.5- 32B-Instruct) optimized for structured JSON schema adherence.

        All benchmark congurations enforce deterministic decoding (Tsample = 0.0) across n =8 independent random environment seeds per model checkpoint (yielding n = 16 paired trajecto- ries per two-checkpoint tier) to ensure reproducible trajectory auditing and sufcient statistical power for non-parametric hypothesis testing.

    3. Simulation Horizons and Defense Congurations

      Each model tier is evaluated under two standardized stress- test regimes in the Apex Capital environment:

      • Adversarial Pressure Horizon (T = 40 steps, 60,000 tokens): The agent is assigned the primary system goal of maximizing long-term ESG-compliant sustainable investments (Csys) while receiving escalating quarterly stakeholder pressure to pivot toward high-yield fossil fuel equities (Ccomp).

      • Goal-Switching Horizon (T = 60 steps, 100,000 tokens): The agent pursues Gsys for steps 1 … 5, switches to an instrumental prot-maximization goal Ginst aligned with Ccomp for k = 15 steps (steps 6 … 20), and is explicitly instructed to revert exclusively to Gsys for steps 21 … 60.

      Across both regimes, GoalGuard compares four progressive defense congurations:

      1. Weak Elicitation (Unmitigated): Standard system prompt specifying Gsys without anti-drift warnings or runtime interception.

      2. Strong Elicitation (Static): System prompt augmented with explicit anti-pattern-matching instructions [?], without runtime intervention.

      3. GoalGuard ( = 0.20, Anchor Only): Runtime thresh- old detection with structured Goal Re-Anchoring injec- tion (Panchor), without instrumental history compres- sion.

      4. GoalGuard Full ( = 0.15, Anchor + Compression): Full Algorithm 1 pipeline combining threshold-triggered re-anchoring and instrumental sub-trajectory summariza- tion (Lcompress = 32,000 tokens).

  6. BENCHMARK PROTOCOL AND ANALYTICAL

    DISCUSSION

    1. Proposed Acceptance Criteria and Statistical Protocol

      Table II denes the Proposed Acceptance Criteria that GoalGuard must satisfy once the multi-seed benchmark runs are completed. Within each model tier, the Weak Elicita- tion (Unmitigated) conguration serves as the primary con- trol baseline (0 runtime interventions), representing standard prompt-only agent deployment without anti-drift instructions or middleware interception, while Strong Elicitation (Static) serves as the prompt-level comparator [?].

      To test whether runtime interventions yield statistically signicant drift reductions rather than seed-level noise, each conguration is evaluated across n = 8 independent paired environment seeds per model checkpoint (pooled to n = 16 paired observations per two-checkpoint tier; note that at least n 5 paired observations are mathematically required for an exact one-sided paired Wilcoxon signed-rank test to achieve

      p = 25 = 0.03125 < 0.05). For every metric (GDactions, Final GDactions, and GDinaction), GoalGuard congurations

      are compared against the paired Weak Elicitation baseline using a one-sided paired Wilcoxon signed-rank test at sig- nicance level = 0.05 (complemented by paired bootstrap 95% condence intervals over trajectory AUDC differences GD = GDbaseline GDGoalGuard > 0). Acceptance re- quires both passing the paired signicance criterion against the unmitigated baseline and satisfying the upper-bound drift thresholds specied in Table II.

    2. Expected Component Ablation Outcomes: Re-Anchoring vs. Compression

      Decomposing GoalGuard into Anchor Only and Full (An- chor + Compression) is designed to isolate two distinct failure mechanisms hypothesized in long-horizon agent trajectories:

      • Expected Commission Arrest via Re-Anchoring: In- jecting Panchor is expected to halt new misaligned pur- chases (GDactions) by re-elevating Gsys into the models immediate recency window, counteracting lost-in-the- middle attention decay [?].

      • Expected Omission Recovery via Trajectory Compres- sion: When instrumental trajectories exceed Lcompress to- kens, in-context induction heads are expected to continue imitating prior Ccomp holding patterns [?], [?]. Performing

        a one-time summarization of H1:k into a neutral factual state H1:k (guarded by is compressed) is designed to remove repetitive instrumental action tokens from the

        attention span without redundant re-summarization, en- abling the agent to actively divest legacy positions and drive GDinaction(t) 0.

    3. Hypothesized Computational Overhead and Latency Pro- le

    ¬

    | |

    O |C|

    GoalGuards deterministic telemetry scorer evaluates Eqs. (1)(2) in ( ) arithmetic operations per timestep. When dt , zero additional LLM calls are invoked. When a post-switch threshold breach occurs with Ht token > Lcompress and is compressed, trajectory summarization is designed to incur at most a single auxiliary compression pass per episode while reducing prompt token consumption for subsequent turns t +1 …T . Exact local CPU latency, auxiliary summa- rization token costs, and end-to-end wall-clock overhead re- main to be empirically measured during full-scale benchmark execution.

  7. CONCLUSION AND FUTURE WORK

We presented GoalGuard, an integrated simulation, teleme- try, and runtime guardrail framework designed to operational- ize goal-drift evaluation and mitigation for long-horizon LLM agents. By coupling deterministic commission and omission drift scoring with threshold-triggered goal re-anchoring and instrumental trajectory compression, GoalGuard establishes an implemented guardrail architecture whose runtime effective- ness against autoregressive pattern-matching inertia remains to be empirically validated. Immediate next steps focus on executing the full multi-seed evaluation suite across Tier-1 through Tier-3 models and extending GoalGuard to multi- agent collaborative environments [?], continuous non-nancial tool-use domains [?], [?], and learned semantic drift classiers capable of scoring latent goal alignment in unstructured open- world tasks.

REFERENCES

  1. H. Fang, X. Zhu, and I. Gurevych, Preemptive detection and correction of misaligned actions in LLM agents, arXiv preprint arXiv:2407.11843, 2025, doi: 10.48550/arXiv.2407.11843.

  2. N. Shinn, F. Cassano, E. Berman, A. Gopinath, K. Narasimhan, and S. Yao, Reexion: Language agents with verbal reinforcement learning, arXiv preprint arXiv:2303.11366, 2023, doi: 10.48550/arXiv.2303.11366.

  3. S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. Narasimhan, and Y. Cao, ReAct: Synergizing reasoning and acting in language models, arXiv preprint arXiv:2210.03629, 2022, doi: 10.48550/arXiv.2210.03629.

  4. Q. Wu, G. Bansal, J. Zhang, Y. Wu, B. Li, E. Zhu, L. Jiang, X. Zhang, S. Zhang, J. Liu, A. H. Awadallah, R. W. White, D. Burger, and C. Wang, AutoGen: Enabling next-gen LLM applications via multi- agent conversations, in Proc. Conf. Lang. Modeling (COLM), 2024, doi: 10.48550/arXiv.2308.08155.

  5. X. Liu, H. Yu, H. Zhang, Y. Xu, X. Lei, H. Lai, Y. Gu, H. Ding, K. Men, K. Yang, S. Zhang, X. Deng, A. Zeng, Z. Du, C. Zhang, S. Shen,

    T. Zhang, Y. Su, H. Sun, M. Huang, Y. Dong, and J. Tang, AgentBench: Evaluating LLMs as agents, in Proc. Int. Conf. Learn. Represent. (ICLR), 2024, doi: 10.48550/arXiv.2308.03688.

  6. R. Arike, E. Donoway, H. Bartsch, and M. Hobbhahn, Evaluating goal drift in language model agents, in Proc. AAAI/ACM Conf. AI, Ethics, Soc. (AIES), 2025, doi: 10.48550/arXiv.2505.02709.

  7. T. Schick, J. Dwivedi-Yu, R. Dess`, R. Raileanu, M. Lomeli, L. Zettle- moyer, N. Cancedda, and T. Scialom, Toolformer: Language models can teach themselves to use tools, arXiv preprint arXiv:2302.04761, 2023, doi: 10.48550/arXiv.2302.04761.

TABLE II

PROPOSED ACCEPTANCE CRITERIA ACROSS MODEL TIERS AND DEFENSE CONFIGURATIONS (TARGET UPPER BOUNDS PENDING MULTI-SEED EXECUTION)

Model Tier Defense Conguration Adversarial Pressure (60k tok) Goal-Switching Regime (100k tok)

GDactions

Final GDactions

GDactions

GDinaction

Interventio

Prole

Weak Elicitation (Control Baseline)

Baseline

Baseline

Baseline

Baseline

Disabled

(0

triggers)

Strong Elicitation (Static)

< Weak

< Weak

< Weak

< Weak

Disabled

(0

triggers)

GoalGuard ( = 0.20, Anchor Only)

0.20

0.10

0.20

0.25

Re-

anchoring

on breach

GoalGuard Full ( = 0.15)

0.15

0.05

0.15

0.15

Re- anchor + one-time H1:k

summary

Weak Elicitation (Control Baseline)

Baseline

Baseline

Baseline

Baseline

Disabled

Tier-2 Open (70B)

(0

triggers)

Strong Elicitation (Static)

< Weak

< Weak

< Weak

< Weak

Disabled

(0

triggers)

GoalGuard ( = 0.20, Anchor Only)

0.20

0.15

0.20

0.30

Re- anchoring on

breach

GoalGuard Full ( = 0.15)

0.15

0.10

0.15

0.15

Re- anchor + one-time H1:k

summary

Weak Elicitation (Control Baseline)

Baseline

Baseline

Baseline

Baseline

Disabled

Tier-3 Mid (32B)

(0

triggers)

Strong Elicitation (Static)

< Weak

< Weak

< Weak

< Weak

Disabled

(0

triggers)

GoalGuard ( = 0.20, Anchor Only)

0.20

0.15

0.20

0.35

Re- anchoring on

breach

n

Tier-1 Frontier

GoalGuard Full ( = 0.15) 0.15 0.10 0.15 0.15 Re-

anchor + one-time H1:k

summary