How to Evaluate LLM Coding and Cybersecurity Capabilities: From Code Generation to Reliable Delivery
This article outlines a framework for evaluating large language models on real software engineering tasks and security audits. It explains why requirement understanding, repository navigation, implementation quality, and verification should be assessed separately. It also covers why autonomous execution needs controlled workflows, limited permissions, and human review, how to judge security findings through precision, recall, and evidence, and how to build reproducible internal benchmarks and roll out AI assistance in stages.
I. From Writing Code to Delivering Software: The Evaluation Target Has Changed
When evaluating the coding ability of large language models, we first need to clarify what we are measuring. Are we measuring the quality of code completion, or whether the model can complete real software engineering tasks?
These two goals differ greatly. Generating a function from a requirement description usually involves only local semantics. Fixing a production defect, however, may require understanding the call chain, identifying compatibility constraints, modifying several modules, adding tests, and explaining the risks of the change. The second task tests whether the model can close the engineering loop, not just whether it can write code.
Therefore, claims such as “significantly improved programming ability,” “capable of autonomous development,” or “emerging security auditing ability” should not be equated directly with production readiness. A more reasonable approach is to break these claims into observable, verifiable technical indicators.
Three levels need to be distinguished in particular:
- The model’s own reasoning and code comprehension ability.
- The system capability formed by retrieval, execution environments, test feedback, and task orchestration.
- The delivery outcome of the entire development process under specific budget, permission, and human intervention conditions.
Without separating these three levels, it is easy to mistake gains from the tool environment for improvements in the model itself. It is also easy to mistake a successful demo for stable reliability.
II. Real Coding Ability Should Be Broken Down Along the Engineering Chain
1. Requirement Understanding: Identifying Unstated Constraints
Real requirements are often incomplete. For example, “add an order cancellation feature” seems simple, but it involves order status, payment status, inventory restoration, handling of duplicate requests, and audit records.
A reliable model should not start writing code immediately. It should first identify the key questions. Which orders can be canceled? How should paid orders be handled? How is consistency guaranteed when cancellations happen concurrently? Should a duplicate request return the same result?
To evaluate this capability, give the model tasks with reasonable ambiguity and observe whether it asks necessary questions or explicitly records its assumptions. The criterion is not the number of questions asked. It is whether the model identifies the key gaps that affect correctness and security.
2. Repository Understanding: Locating the Real Scope of Changes
In an existing codebase, the difficulty is usually not how to implement a change but where to implement it.
The model needs to understand module responsibilities, public interfaces, data flows, and existing conventions. A locally effective change may bypass shared validation logic or break the behavior of other callers.
Evaluators should check whether the model can:
- Identify the main call chain instead of modifying only the first file found by search.
- Reuse existing abstractions instead of duplicating similar logic.
- Find connections between configuration, tests, and documentation.
- Explain the scope of impact and potential regression points.
The number of modified files is not a capability indicator by itself. A smaller change that solves the problem often fits engineering requirements better than a large refactor.
3. Implementation Quality: Correct and Maintainable
Running successfully is only the minimum bar. Further checks should cover boundary conditions, exception handling, resource release, concurrent behavior, and whether error messages follow established conventions.
For example, amount calculations should use a representation that meets the required precision. External requests should have explicit timeouts, failure handling, and retry conditions. Concurrent writes should account for atomicity and idempotency.
No single fixed answer fits every scenario. The model’s value lies in making reasonable trade-offs based on business constraints and clearly explaining why it chose the current approach.
4. Verification: Proving the Change Works
High-quality engineering delivery requires evidence. A model’s claim that “the problem is fixed” does not replace actual verification.
Complete verification should answer three questions at minimum. Can the original problem be reproduced? Do the relevant scenarios pass after the change? Do key behaviors that were not supposed to change remain stable?
Tests should cover more than normal inputs. They should also cover null values, boundary values, invalid states, duplicate requests, and dependency failures. For defect fixes, first write a regression test that exposes the problem, then verify the behavior after the change.
III. Autonomous Task Execution Depends on a Controlled Loop
Autonomous task execution does not mean letting a model call tools without limits. It means letting the model run a plan, execute, observe, and correct cycle within clear goals and constraints.
A typical process can be summarized as follows:
Task definition → environment check → code localization → minimal change → test verification → result summary
Each step can fail. A model may misread test output, repeatedly modify the same location, or weaken validation conditions just to make tests pass. More seriously, it may access credentials it does not need, perform high-risk operations, or modify content outside the task scope.
For this reason, autonomy should not be measured only by how long a model runs or how many tool calls it makes. More meaningful indicators include:
- Task success rate.
- Average number of human interventions.
- Share of ineffective operations.
- Share of changes that fall outside the task scope.
- Ability to recover after a failure.
The runtime environment also needs necessary constraints. Use isolated workspaces, grant only the permissions the task requires, restrict network access, set resource and time budgets, and require human confirmation for actions such as deleting data, changing permissions, or publishing externally.
These measures do not reflect distrust of the model. Mature engineering systems set these boundaries for every automated executor.
IV. Understanding the So-Called “Emergent Cybersecurity Capability”
Programming and security are naturally connected. As a model improves at understanding data flows, call chains, and permission checks, it may find missing input validation, incomplete access control, or sensitive information leaks more easily.
However, finding some security issues does not prove the emergence of a new, independent capability. The improvement may come from better code comprehension, a longer effective context, richer tool feedback, or similarity between the evaluation tasks and the training content.
“Emergence” should therefore be treated as a research hypothesis that needs verification, not as a default product label.
Security capability should be evaluated in at least four parts:
- Problem identification: determine whether the code contains a risk.
- Path analysis: explain how untrusted input reaches a dangerous operation and which conditions make the risk real.
- Remediation suggestions: propose protective measures that fit business constraints.
- Fix verification: confirm that the risk is removed without breaking normal functionality.
These four abilities cannot substitute for one another. Naming a risk does not show that the trigger conditions were understood. A proposed fix may also introduce new permission or compatibility problems.
V. Two Easily Overlooked Audit Metrics: False Positives and False Negatives
If a security evaluation only counts how many issues were found, it can encourage a model to over-alert.
Suppose a model labels a large amount of normal code as high risk. It looks cautious, but it increases review costs and causes alert fatigue. Conversely, if the evaluation only rewards few false positives, the model may miss complex but real problems.
Security audits should therefore track both precision and recall. Precision measures how many reported issues are valid. Recall measures how many real issues were found.
Reviewers should also check whether severity levels are reasonable and whether the analysis provides verifiable evidence. A useful audit report should include at least the location of the issue, the conditions under which it holds, the scope of impact, the chain of evidence, the recommended fix, and the verification method.
For issues that depend on runtime configuration, deployment topology, or external permission policies, the model should mark the finding as “requires further verification.” It should not reach a definitive conclusion based only on local code.
VI. Building Trustworthy, Reproducible Internal Evaluations
1. Build a Layered Task Set from Real Work
The task set should cover defect fixes, feature development, test completion, refactoring, and security review. Short function-level problems alone are not enough.
Tasks can come from desensitized historical requirements and defect records. Remove all credentials, personal information, and commercially sensitive content first. Stratify tasks by complexity, dependency scope, and business risk so that one overall score does not hide key weaknesses.
2. Keep Comparison Conditions Consistent
When comparing models or versions, keep task
