Evaluating LLMs for Long-Context Code Development: Capability Boundaries and Engineering Practices
This article evaluates the capabilities of large language models (LLMs) in long-context code development through two real-world projects: modifying a legacy system with security constraints and building an application from scratch. We explore the impact of post-training on long-context capabilities, examine the limitations of LLMs in handling implicit security boundaries, and discuss their potential in security audits and CI/CD integration. Finally, we provide a practical checklist for engineering implementation, emphasizing a human-AI collaborative approach where humans focus on architecture, security, and final acceptance.
1. Why Focus on Long-Context Code Capabilities
The role of LLMs in software development is shifting from “code snippet generators” to “long-context task collaborators.” Developers are primarily concerned with three aspects: whether the model can comprehend extensive legacy code, whether it can make coordinated changes across multiple modules, and whether it can push tasks to a runnable and testable state. Standard benchmark scores cannot answer these questions, so this article conducts tests using two distinct real-world projects.
2. How Post-Training Affects Long-Context Capabilities
Instead of merely scaling up parameters, some open-source base models invest more resources into the post-training phase. This involves expanding the volume of long-context task data, the variety of interactive environments, and the complexity of tasks, allowing the model to encounter multi-step workflows similar to production environments during training.
The direct effect of this training method is that the model can work continuously within a Monorepo, handling the complete pipeline across front-end interfaces, back-end APIs, databases, and asynchronous tasks. Taking an animation video generation pipeline as an example, early models could typically only write a single API or component, whereas current models can design data contracts uniformly, manage task state transitions, and coordinate the Web layer with the rendering engine.
3. Case Study 1: Legacy System Modification and Security Boundaries
The first scenario involves a project with a long development history and multiple security constraints. The task was to add “secure user image asset import and HTML animation scene referencing” features.
The model first analyzed the authentication system, file upload mechanism, and resource distribution logic. It located the existing storage adapter interface and wrote the asset import logic according to existing calling conventions. When implementing the HTML animation referencing, the model proactively added sandbox isolation to prevent XSS attacks and completed the front-end and back-end API integration, bringing the feature to a runnable state.
Automated tests passed completely, but during manual permission boundary stress testing, a P1-level permission isolation vulnerability was discovered. While implementing multi-tenant asset referencing, the model failed to fully understand the implicit binding relationship between user ownership and asset ownership in the legacy system. Under specific parameter construction, Tenant A could access Tenant B’s animation resources without authorization.
The automated tests covered functional and standard boundary cases but missed cross-tenant unauthorized access scenarios, so the results did not reflect this risk. This highlights two points: First, models tend to satisfy explicit functional requirements but are weaker at controlling system-level implicit constraints. Second, all-green tests do not equate to production-grade secure delivery.
The table below lists the differences among three types of inspection items in this scenario:
| Category | Example | Verification Method |
|---|---|---|
| Explicit Function | Asset upload, animation referencing, API integration | Automated testing |
| Implicit Security Boundary | User and asset ownership binding, cross-tenant access | Permission stress testing and manual review |
| Business Acceptance | Usage flow in real tenant scenarios | Manual acceptance |
4. Case Study 2: Building a Complete Application from Scratch
The second scenario tested the model’s closed-loop capability from material analysis to product delivery. The input was only a general Agent technical learning database and a Product Requirements Document (PRD), with the goal of implementing an “Agent knowledge learning game” that can be completed.
The task proceeded with the following steps:
- Deconstructed the PRD and material database to extract core rules, level logic, and knowledge point mappings.
- Designed the front-end interaction state machine, clarifying the switching conditions for each game stage.
- Designed back-end progress persistence and knowledge retrieval logic.
- Located files based on terminal errors and fixed type mismatches and missing dependencies.
- Verified level by level according to the main game flow, ensuring players could complete quizzes and finish the game.
The model maintained good coherence during multiple rounds of autonomous coding and debugging. The final code compiled and started successfully, and the main game flow ran smoothly. No precise timing or human intervention counts were recorded, so exact time consumption cannot be provided. However, it is certain that the task spanned a considerable duration, crossing multiple files and debug rounds.
5. Extension to Cybersecurity Auditing
In addition to coding, models can participate in security audits. In the selected samples of common injection vulnerabilities and sensitive information leaks, the model provided effective risk clues. However, without systematic comparison with closed-source models, its relative position cannot be determined, so no ranking is provided.
If you plan to integrate the model into a CI/CD pipeline as a supplement to Static Application Security Testing (SAST), the following prerequisites are recommended:
- The model’s access permissions follow the principle of least privilege, reading only necessary code repositories.
- Fix scanning rules and prompt templates to avoid different conclusions for the same code across different versions.
- Set up a manual review process for reported issues, recording false positives and adjusting periodically.
- Treat model results only as a supplementary signal, not directly as a basis for blocking merges.
In complete vulnerability exploitation scenarios, such as generating executable penetration test PoCs, the model’s capabilities are limited by security alignment policies. Such work requires professional security tools and must be conducted only within authorized testing scopes.
6. Engineering Implementation Recommendations
Based on the above tests, the new generation of open-source models is worthy of in-depth trials in real projects, especially for logic-intensive, time-consuming long-context development tasks. They can reduce substantial mechanical coding work and maintain code output coherence during cross-end collaboration.
However, all-green tests do not mean safe delivery. Steps involving system permissions, data security, and final business acceptance must be vetted by human engineers. Teams can refer to the following implementation checklist:
- Lock the model version and record the version number used for each test.
- Design dedicated unauthorized access test cases for permission boundaries, covering multi-tenant scenarios.
- Develop a manual acceptance checklist, distinguishing between functional and security acceptance.
- Prepare a rollback plan to ensure model-generated changes can be safely reverted.
- Record human intervention counts and time consumption to provide data for subsequent evaluations.
Having the model handle heavy code implementation and initial debugging while engineers guard architectural design, security boundary reviews, and final acceptance is a human-AI collaborative approach more suited to the current stage of capabilities.
