Your Agent Has a Genome: Sequence-Level Behavioral Analysis and Runtime Governance of LLM-Powered Autonomous Agents
Organizations: Independent Researcher
Abstract
We propose Base Sequence Analysis, a framework that encodes the runtime behavior of LLM-powered autonomous agents into compact symbolic sequences using a four-letter alphabet: X (Explore), E (Execute), P (Plan), and V (Verify). Drawing an analogy to genomic sequence analysis, we apply n-gram pattern mining, Markov transition matrices, and point-biserial correlation to 347 real-world execution traces collected from a production ReAct agent system over 8 days. Our analysis reveals that (1) the trigram P-X-P is the only statistically significant high-risk pattern, lowering success rate by 10.4%; (2) P-ratio is the strongest negative predictor of success (r=-0.256, p<0.0001); and (3) the E->V transition probability is only 2.1%, indicating a systemic verification deficit. Based on these findings, we design Governor, a three-layer runtime intervention system comprising a rule engine, a statistical accumulator, and a chi-square-based threshold adaptor. In a natural before/after deployment evaluation (N=101 vs. N=246), Governor achieves a +6.2% absolute increase in task success rate while simultaneously reducing average token consumption by 44%. To validate cross-system generality, we apply the XEPV encoding to 2,000 public SWE-agent trajectories on SWE-bench, confirming that exploration spirals and the E->V verification deficit replicate in an independent system. We outline six research directions including base sequence language models, cross-agent behavioral fingerprinting, and reward shaping, and release an open-source toolkit for reproducibility.
Figures & tables
| Feature | Definition | Complexity |
|---|---|---|
| consecutiveX | Trailing consecutive X count | |
| stepCount | Total sequence length | |
| xRatioLast5 | X ratio in last 5 bases | |
| switchRate | Adjacent-pair switch frequency | |
| pInLateHalf | P present in second half | |
| lastPFollowedByV | Most recent P followed by V |
| Metric | Value |
|---|---|
| Total traces | 347 |
| Success rate | 92.5% |
| Mean sequence length | 8.7 steps |
| Max sequence length | 44+ steps |
| Total base count | 3,015 |
| Unique tools used | 20+ |
| Base | Count | Ratio | Interpretation |
|---|---|---|---|
| X (Explore) | 1,406 | 46.6% | Information gathering dominates |
| E (Execute) | 1,131 | 37.5% | State-changing actions |
| P (Plan) | 379 | 12.6% | Reasoning and strategy |
| V (Verify) | 99 | 3.3% | Validation (critically low) |
| Trigram | Tasks | Success | vs. Global | Significance |
|---|---|---|---|---|
| P-X-P | 42 | 83.3% | 10.4% | |
| X-E-X | 42 | 90.5% | 2.3% | ns |
| X-X-X | 143 | 94.4% | 3.2% | ns |
| Pattern | Tasks | Success | Note |
|---|---|---|---|
| E-V | 20 | 100% | Execute-then-verify |
| E-E-V | 10 | 100% | Execute chain + verify |
| E-E-E | 97 | 95.9% | Sustained execution |
| E | P | V | X | |
|---|---|---|---|---|
| E | 68.0% | 9.8% | 2.1% | 20.1% |
| P | 20.7% | 0.0% | 22.5% | 56.8% |
| V | 19.5% | 40.2% | 1.1% | 39.1% |
| X | 23.0% | 19.6% | 0.2% | 57.2% |
| Feature | -value | Sig. | |
|---|---|---|---|
| P_ratio | 0.256 | ||
| switch_rate | 0.134 | 0.013 | |
| E_ratio | 0.132 | 0.014 | |
| has_V | 0.092 | 0.088 | ns |
| length | 0.067 | 0.213 | ns |
| X_ratio | 0.033 | 0.542 | ns |
| Metric | Failed | Succeeded | |
|---|---|---|---|
| Mean length | 7.1 | 8.8 | 1.7 |
| E ratio | 23.4% | 38.4% | 15.0% |
| P ratio | 23.4% | 11.9% | 11.5% |
| V ratio | 1.6% | 3.4% | 1.8% |
| X ratio | 51.6% | 46.3% | 5.3% |
| Rule | Trigger | Intervention | Empirical Basis |
|---|---|---|---|
| x_brake | consec. X 12 | Stop exploring, change direction | X X self-loop 57.2% |
| switch_warn | switch rate 60% | Focus on one direction | switch_rate |
| miss_verify | E streak 3 with no V | Verify your work now | E V only 2.1% |
| explore_dom | X/(X+E) 55% | Reduce exploration, execute | xeRatio imbalance |
| div_collapse | Last 5 steps all same | Break the loop | Diversity collapse |
| late_plan | P in second half | Stop re-planning, execute | pInLateHalf negatively correlated |
| Parameter | V1 | V4 | Rationale |
|---|---|---|---|
| consecutiveXBrake | 8 | 12 | Data: 8–12 consec. X success 1pp |
| exploreDomRatio | 0.70 | 0.55 | V1 threshold too high, almost never triggered |
| step_fuse | enabled | disabled | Tasks 15 steps: 97.4% success |
| Group | Success | Avg Tokens | Avg Length | |
|---|---|---|---|---|
| Pre-Governor | 101 | 88.1% | 275K | 22.2 |
| Post-Governor (all) | 246 | 94.3% | 154K | 14.0 |
| Triggered | 193 | 96.4% | 179K | 16.3 |
| Not triggered | 53 | 86.8% | 65K | 5.6 |
| Rule | Tasks | Success | Avg Tokens | Assessment |
|---|---|---|---|---|
| x_brake | 146 | 98.6% | 171K | Most valuable |
| switch_warn | 88 | 95.5% | 205K | High frequency, effective |
| miss_verify | 54 | 96.3% | 241K | Moderate frequency |
| explore_dom | 50 | 96.0% | 210K | Moderate frequency |
| late_plan | 32 | 93.8% | 228K | Moderate frequency |
| step_fuse | 43 | 100% | 305K | Disabled (validates decision) |
| Group | Tokens/Success | Relative |
|---|---|---|
| Pre-Governor | 313K | 1.0 (baseline) |
| Post-Governor (triggered) | 186K | 0.59 ( 41%) |
| Post-Governor (not triggered) | 74K | 0.24 |
| Configuration | Success% | Mean Tokens | Mean Steps |
|---|---|---|---|
| No-error baseline | 97.0 | 119K | 12.4 |
| Reflexion only | 89.6 | 270K | 18.7 |
| Governor + Reflexion | 94.3 | 154K | 14.1 |
| Metric | Resolved ( ) | Unresolved ( ) | Direction |
|---|---|---|---|
| 54.2% | 28.1% | better | |
| 41.5% | 63.6% | better | |
| 74.6% | 84.8% | better | |
| Mean max X-run | 4.8 | 11.0 | better |
| V ratio | 24.7% | 15.7% | better |
| X ratio | 33.6% | 44.9% | better |
| 4-gram | Res. freq. | Unres. freq. | Lift | Interpretation |
|---|---|---|---|---|
| XEVE | 0.515 | 0.251 | 2.05 | Explore-Edit-Verify-Edit cycle |
| VXXE | 0.198 | 0.105 | 1.89 | Post-verify targeted search |
| XXEV | 0.538 | 0.398 | 1.35 | Exploration verified edit |
| EEEE | 0.822 | 4.904 | 0.17 | “Blind-edit spiral” |
| XXXX | 2.429 | 8.993 | 0.27 | Extended exploration spiral |
| VVVV | 0.000 | 0.325 | 0.00 | Test-only loop (never resolved) |
| Model | X% | E% | V% | Resolved% | |
|---|---|---|---|---|---|
| Llama-405B | 40 | 34.0 | 39.9 | 26.1 | 42.5 |
| Llama-70B | 1,793 | 43.0 | 40.0 | 17.0 | 16.2 |
| Llama-8B | 167 | 44.8 | 38.2 | 17.0 | 18.0 |
| N-gram | Combinations | Est. Traces Needed | Feasibility |
|---|---|---|---|
| 2-gram | 16 | 300 | ✓This paper |
| 3-gram | 64 | 1,500 | Single power user, months |
| 4-gram | 256 | 5,000 | Single user, 1 year |
| 5-gram | 1,024 | 50,000 | Requires community data |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Category | Tools |
|---|---|
| Read (X) | readFile , listDir , searchText , searchFiles |
| Explore (X) | webSearch , webFetch |
| Write (E) | writeFile , appendFile , deleteFile , renameFile |
| Verify (V) | Write-then-read, retry-after-error, test/lint commands |
| Plan (P) | LLM-assigned via reasoning metadata |
| Rule | Injection Text |
|---|---|
| x_brake | “[Base Sequence Warning] You have performed {n} consecutive exploration operations. Please stop and re-analyze the problem with a completely different approach.” |
| switch_warn | “[Strategy Consistency] Your operations are switching between directions at {rate}% frequency. Please focus on one direction and push through.” |
| miss_verify | “[Verification Missing] You have executed {n} consecutive operations without verifying results. Data shows E V transitions correlate with 100% success rate. Please verify your work now.” |
| late_plan | “[Late Planning Warning] Task is at step {n} (past halfway) and you are still re-planning. Late planning correlates with lower success rate. Please execute with existing information.” |
AI Agent Governance
AI agent governance studies how to authorize, constrain, monitor, and hold autonomous and multi-agent systems accountable.
See all 445 papers