Capability Boundaries and Acceptance Testing for Long-Horizon Coding Agents
Long-horizon coding agents can now push complex, cross-module changes to a runnable and testable state in real projects, but they still cannot automatically prove that security constraints hold across all paths. This article examines what these agents can and cannot do, based on two hands-on tasks—retrofitting a security-sensitive asset import and HTML animation feature into a legacy project, and building a complete learning game from source material and a PRD. It explains why long tasks reveal more than benchmark scores, where the capability gains come from (post-training scaling on long-horizon environments), and outlines a practical engineering approach: front-loading constraints, slicing work along security boundaries, testing abnormal paths, and maintaining human acceptance checklists for permissions, tenancy, and audit trails.
Capability Boundaries and Acceptance Testing for Long-Horizon Coding Agents
Conclusion First: The Capability Ceiling Is Rising, but Acceptance Boundaries Must Remain
Evaluating whether a coding agent is truly production-ready cannot rely solely on public leaderboard scores or its ability to generate runnable code in one shot. What matters more is whether it can understand complex context in long tasks, keep pushing forward cross-module changes, and bring a task to a state that is runnable, testable, and reviewable.
Based on the recent performance of a class of long-horizon coding agents, the conclusions can be summarized in three points:
- Long-horizon coding capability is genuinely advancing. These agents can already locate relevant modules in projects with significant legacy baggage, understand interface constraints, and complete coordinated changes across frontend, backend, task state, data storage, and rendering chains.
- They are worth testing against real projects. Especially tasks that span modules and states and require multiple rounds of validation—these reveal capability differences far better than single-file generation.
- They have not reached the point where “all tests green” means safe to ship. Passing tests only proves known cases pass; it does not replace a permission model, security boundaries, and final human acceptance.
A typical observation: two projects both ran successfully, and a learning game built from scratch could be fully completed end to end. Yet in the legacy project retrofit, human acceptance still uncovered a P1-level permission isolation issue. This shows that agents excel at closing the implementation loop, but whether security constraints hold on every path still requires human sign-off.
Why Long Tasks Reveal More Than Leaderboards
Short tasks usually have clear objectives, limited context, and a single acceptance criterion—for example, generating a function, adding a component, or fixing a local error. Such tasks demonstrate code generation quality but rarely demonstrate engineering capability.
Long tasks are different. They typically involve:
- Complex context: simultaneously understanding legacy code, database schemas, interface contracts, task states, frontend reference patterns, and security policies.
- Cross-module changes: a single requirement may touch the data model, server-side APIs, async tasks, frontend pages, and the renderer.
- Long state chains: from asset upload, review, storage, and referencing to page rendering—any missing constraint at any link can leave a vulnerability.
- Non-unique acceptance: runnable does not mean correct, tests passing does not mean permission isolation holds, and page visibility does not mean tenant boundaries are secure.
Therefore, when evaluating long-horizon coding agents, focus on four indicators:
- Whether it can read the existing system’s constraints, rather than bypassing them and rewriting.
- Whether it can sustain progress across multiple rounds, rather than losing context after the first generation.
- Whether it can bring the task to a runnable, testable state.
- Whether it proactively surfaces risks around security, permissions, and final acceptance.
Where the Gains Come From: Post-Training Scaling and Long-Horizon Environments
These capability gains typically do not come from swapping in a new foundation model. They come from post-training scaling: expanding the scale of long-horizon task environments, increasing environment variety, and extending training time, so the model learns to plan, modify, verify, and repair in multi-step environments that more closely resemble real engineering.
Official and technical materials typically summarize the improvements in three directions:
- Coding capability: greater emphasis on long-horizon tasks and production-grade software engineering, not just single-point code generation.
- Security capability: extending from code generation to white-box code review, vulnerability reasoning, and risk localization.
- Engineering loop: maintaining top-tier performance on terminal-operation and software-engineering public benchmarks, though full vulnerability exploitation and complex security acceptance still show gaps.
A note of caution here: white-box review capability is useful, but it is more of a “risk discovery aid” than a “replacement for security team sign-off.” A coding agent can flag suspicious permission checks, missing validations, dangerous string concatenation, and privilege escalation paths, but full vulnerability exploitation, business-level permission semantics, and final delivery responsibility must remain with humans.
Hands-On Scenario 1: Secure Asset Import and Animation Referencing in a Legacy Project
The first task was to add “secure user image asset import with HTML animation scene referencing” to a project with a substantial amount of legacy code. On the surface this looks like image upload and page display, but it actually spans multiple security boundaries:
- Users may only import assets they or their tenant are authorized to use.
- Assets must be validated for type, size, digest, and storage path, to prevent path traversal and malicious files.
- Imported assets should carry a status, such as pending review, available, or disabled.
- HTML animation scenes referencing assets must restrict tags, attributes, and URL protocols to prevent script injection.
- Private assets must not expose public URLs directly; access should go through short-lived signed URLs or a controlled proxy.
- All imports, references, deletions, and permission changes must be recorded in audit logs.
The agent showed strong advantages in this task: it located the legacy system’s data models, API layer, task states, and frontend reference points, proposed a cross-module change plan, and continuously fixed runtime errors. It could push the feature to a runnable state.
But that is also where the problem lies. Although the first project ran successfully, human acceptance still uncovered a P1-level permission isolation issue. Typical root causes include:
- Only checking “is the current user logged in,” without checking “does this user belong to this tenant and have permission for this scene.”
- Enumerable asset IDs: the query API returns data by ID without tenant-level filtering.
- The frontend hides a button, but the backend endpoint can still be called directly.
- Signed URLs are issued after only checking that the asset exists, without checking permission on the referencing scene.
- Audit logs record successful operations but not failed unauthorized access attempts.
Such issues show that an agent can complete the “functional path” but does not automatically prove that “all abnormal paths are secure.” If test cases do not cover cross-tenant access, role revocation, asset reuse, and direct API calls, all-green tests can still mask permission vulnerabilities.
A more robust asset import validation should reflect multi-layer constraints in its pseudocode:
def import_asset(user, file, scene_id):require_authenticated(user)require_permission(user, "asset:import", scene_id)require_same_tenant(user.tenant_id, scene_id)if file.size > MAX_ASSET_SIZE:raise ValidationError("asset too large")if file.mime not in ALLOWED_IMAGE_TYPES:raise ValidationError("unsupported asset type")digest = sha256(file.stream)key = build_private_key(tenant_id=user.tenant_id,scene_id=scene_id,digest=digest)object_store.put_private(key, file.stream)asset = db.insert_asset(tenant_id=user.tenant_id,owner_id=user.id,scene_id=scene_id,object_key=key,status="pending_review")audit(user, "asset.import", asset.id, result="success")return asset.id
HTML animation referencing also needs whitelist-style handling, not just filtering a few keywords:
ALLOWED_TAGS = {"div", "span", "p", "img", "section"}ALLOWED_ATTRS = {"class", "style", "src", "alt", "data-scene"}def render_scene(html, user, scene_id):require_permission(user, "scene:render", scene_id)tree = parse_html(html)for node in tree.walk():if node.tag not in ALLOWED_TAGS:node.remove()for attr in list(node.attrs):if attr not in ALLOWED_ATTRS:node.remove_attr(attr)for url in node.urls():if not is_allowed_asset_url(url, user.tenant_id, scene_id):node.remove()return tree.to_html()
The key is not how complex the code is, but that permissions, tenancy, scenes, asset status, and auditing must form a closed loop on the same chain.
Hands-On Scenario 2: From Source Material and a PRD to a Fully Completable Learning Game
The second task provided only learning material and a product requirements document, asking for a knowledge-learning game to be built from scratch that can be fully completed end to end. This task tests completeness from material analysis to product delivery.
The agent needed to:
- Extract knowledge points from the material and structure them into levels and questions.
- Design the game state machine: start, answer, score, feedback, next level, and completion.
- Implement frontend-backend data flow so progress can be saved and restored.
- Provide testable scoring logic and completion conditions.
- Handle abnormal inputs, such as duplicate submissions, level skipping, empty questions, and progress tampering.
Agents usually perform well on this kind of task because they can decompose the requirements into clearly separated modules and quickly generate a runnable prototype. They can wire together pages, state, question data, and completion logic to reach a “fully completable” demo standard.
But we must still distinguish “demo-ready” from “production-ready.” A learning game at minimum also needs:
- Level data versioning, so old progress does not break after question updates.
- Server-side scoring or validation, to prevent client-side score tampering.
- Duplicate-submission prevention and idempotency controls.
- Progress restoration and cross-device consistency.
- Observability: level failure rates, abnormal submissions, and completion times.
- Content moderation and copyright compliance.
From-scratch projects are easier to get running because constraints are few and paths are short; legacy projects are riskier because implicit permissions and business semantics live in the old system. Taken together, the agent’s long-horizon execution capability is worth testing on real projects, but security-sensitive systems must add human acceptance.
Engineering Practices: Keeping Long-Horizon Coding Under Control
To make coding agents effective in real projects, consider the following practices.
1. Front-load constraints instead of patching afterward
Before the task begins, write down the non-negotiable constraints: tenant isolation, role permissions, asset statuses, allowed HTML tags, audit requirements, and failure rollback strategy. The earlier the constraints are stated, the less likely the agent is to bypass security boundaries during implementation.
2. Slice along security boundaries
Do not ask for “complete asset import and animation referencing” in one shot. Break it into: upload validation, asset storage and status, permission queries, scene referencing, HTML whitelisting, audit logging, and unauthorized-access tests. Each slice has explicit acceptance criteria.
3. Test cases must cover abnormal paths
Beyond normal import and rendering, cover cross-tenant access, direct API calls, access after role revocation, referencing disabled assets, malicious HTML, path traversal, duplicate submissions, and concurrent modifications. All-green tests are a baseline, not a security proof.
4. Build a human acceptance checklist
At minimum:
- Can users in the same tenant access other users’ assets without authorization?
- Is cross-tenant lookup by ID properly filtered?
- After a button is hidden in the frontend, does the backend API still enforce permissions?
- Are signed URLs short-lived and bound to scene permissions?
- Does the HTML animation reject script protocols and dangerous attributes?
- Do audit logs record both successful and failed operations?
- Can failed operations be rolled back, and is state consistent afterward?
5. Preserve observability and audit trails
Long-horizon tasks produce many changes, and they must be traceable. Key operations should have structured logs with request IDs, tenant IDs, user IDs, asset IDs, and result status. Otherwise, when a P1 issue appears, it becomes very hard to determine whether it came from a permission check, a data filter, or a frontend reference.
The Boundaries of Security Review Capability
The agent’s improvements on the security front deserve attention: it can perform white-box code review, identify suspicious permission checks, missing validations, dangerous concatenation, and unauthorized queries, approaching a high level on basic security tasks. But gaps remain in full vulnerability exploitation, complex business permission semantics, and final security acceptance.
The reasonable positioning is therefore:
- Suitable as a security review aid: have the agent list risk points, generate unauthorized-access test cases, and check permission filter conditions.
- Not suitable for security sign-off: the final permission model, tenant isolation, and delivery acceptance must be confirmed by humans.
- Never assume all-green tests mean secure: security properties require dedicated test cases and human review.
Conclusion: Worth Testing on Real Projects, but Humans Cannot Let Go
Across both tasks, long-horizon coding agents have pushed the capability ceiling forward. They can sustain cross-module changes in complex contexts and bring tasks to a runnable, testable state, and they are well suited to building fairly complete product prototypes from source material and requirement documents.
But the P1-level permission isolation issue in the legacy project is a reminder: agents excel at closing the implementation loop, not at automatically proving the security loop is closed. When permissions, security, tenant isolation, and final acceptance are involved, humans cannot let go yet.
The more prudent practice: use real projects to test long-horizon coding capability, use security-boundary slicing to control risk, and use abnormal-path test cases and human acceptance to hold the line. All-green tests are only the beginning—reviewable, auditable, and deliverable is the endpoint.
