cs.SEFeb 28, 2026

ContextCov: Deriving and Enforcing Executable Constraints from Agent Instruction Files

Authors: Reshabh K Sharma

Organizations: University of Washington Seattle, Washington, USA

Abstract

As Large Language Model (LLM) agents increasingly execute complex, autonomous software engineering tasks, developers rely on natural language instruction files such as AGENTS.md to express project-specific coding conventions, tooling restrictions, and architectural boundaries. However, because these instructions remain passive text, agents frequently violate documented constraints due to context window saturation or conflicting local context. In autonomous settings without real-time human supervision, such violations rapidly compound into technical debt. To ground autonomous agents in repository constraints, we introduce ContextCov, a framework that transforms passive natural language instructions into executable guardrails. Unlike prompt-only or reflection-only compliance approaches, ContextCov compiles documented constraints into three complementary checks: static AST queries for code patterns, runtime shell shims that intercept prohibited commands, and architectural validators that enforce structural rules. Acting as an automated, continuous reviewer, ContextCov intercepts agent actions and returns immediate, reproducible violation traces, enabling self-correction before non-compliant changes are finalized. We evaluate ContextCov on SWE-bench Lite (12 repositories, 300 tasks). Compared to prompt-only and LLM reflection baselines, ContextCov achieves 88.3% constraint compliance (vs. 67.0% and 50.3%) with 3.4x lower feedback cost, while maintaining functional correctness. The source code and evaluation results are available at https://github.com/reSHARMA/ContextCov.

Figures & tables

Explore similar work

CardsList
  1. Correct Code, Broken Contributions? SWE-CC: Benchmarking Repository Policy Compliance for Coding Agents

    Oct 5, 2026Hai Dang Truong, Rayner Goh, Thanh Le-Cong +1AI Agent AuditingCoding Agents

  2. AgentForge: Execution-Grounded Multi-Agent LLM Framework for Autonomous Software Engineering

    Apr 13, 2026Rajesh Kumar, Waqar Ali, Junaid Ahmed +2Software Engineering AgentsMulti-Agent Coding

  3. Look Before You Leap: Pre-Action Verification for LLM Agents

    Sep 14, 2026Asaad AlthoubiLLM Agent VerificationAI Agent Benchmarks