How Post-Training and Sandbox Scaling Improve Coding and Security Capabilities

    As AI capability research moves beyond parameter counts, post-training quality, interactive environments, and verifiable task loops are becoming equally important. This article explains why smaller models with stronger post-training can compete with larger models, how sandbox scaling improves long-horizon agents, and how organizations can evaluate and deploy coding and security capabilities safely. It also outlines practical criteria for comparing models, environments, and training strategies.

    Beyond Parameter Count: Where Capability Gains Come From

    Discussion of large language model capabilities is shifting from simply increasing parameter counts toward jointly optimizing post-training quality, environment scale, and closed-loop task execution. In some long-horizon agent, software engineering, and security evaluations, a smaller model with more extensive post-training can approach or even outperform a larger model built on a newer architecture.

    This does not mean scaling laws have stopped working. Rather, “scale” is being distributed across several independent curves:

    • Pretraining parameters and data
    • Post-training algorithms and compute
    • The number and fidelity of interactive environments, or sandboxes

    For developers and enterprise users, the key question is not which architecture generation a model belongs to. It is whether the model can modify code in a real repository, run tests, fix defects, and complete multi-step tool calls under restricted permissions. In security-related settings, the question is also whether the model demonstrates measurable capabilities that can be evaluated safely.

    To understand these capabilities, architecture, post-training, and evaluation need to be examined separately.

    Architecture and Post-Training Follow Different Curves

    The pretrained architecture establishes fundamental limits such as context length, attention efficiency, and mixture-of-experts routing. Post-training determines how effectively the model uses those capabilities on verifiable tasks: compiling code, passing tests, making valid tool calls, and converging on multi-step plans.

    In practice, teams often invest heavily in post-training without immediately changing the underlying architecture. On a proven base model, improvements to data composition, preference optimization, process rewards, and rejection sampling can be more reliable than an immediate switch to a new, insufficiently tested architecture.

    There are several reasons:

    • Lower engineering debt: Existing inference stacks, quantization methods, parallelization strategies, and evaluation baselines can be reused.
    • Denser reward signals: Software engineering and agent tasks naturally produce feedback from compilers, test frameworks, static analyzers, and runtime logs, making them suitable as scalable reward sources.
    • More controllable risk: Instability in long-context processing or sparse activation on a new architecture can amplify post-training noise.

    As a result, “smaller parameters plus stronger post-training” outperforming “larger parameters plus a newly aligned architecture” is not a contradiction. Scale still matters; part of it has simply moved from parameter counts to the number of trajectories, environment steps, and verifier calls.

    Long-Horizon Agents: What to Evaluate and Why It Is Difficult

    Long-horizon agents are defined not by single-turn question answering, but by their ability to maintain goals, state, and tool constraints across dozens or hundreds of interactions. Typical capabilities include:

    • Decomposing tasks
    • Selecting appropriate tools
    • Interpreting failure feedback
    • Rolling back incorrect assumptions
    • Delivering results within timeouts and resource quotas

    Evaluations should report at least three categories of metrics rather than relying on a single aggregate score:

    1. End-to-end success rate: Whether the task is considered complete, such as passing the test suite or reproducing a vulnerability and producing a proposed fix.
    2. Process compliance: Whether the agent accessed unauthorized resources, exposed secrets, or performed destructive operations against a production environment.
    3. Sample efficiency and robustness: Retry counts under the same budget, as well as performance variance across repository styles and error types.

    Comprehensive agent evaluations often combine retrieval, coding, planning, and tool use. A small score increase may result from a breakthrough in one sub-capability, evaluation leakage, or prompt overfitting. Results should therefore be broken down by subtask.

    The sandbox image, dependency versions, and random seeds should also be fixed. Otherwise, it is impossible to determine whether the model improved or the environment simply became easier.

    Software Engineering: From Patch Generation to a Verifiable Loop

    Advanced coding capability should not be equated with generating text that resembles code. Enterprise use cases require a verifiable loop:

    1. Locate the defect.
    2. Make the smallest appropriate change.
    3. Pass the relevant tests.
    4. Avoid regressions.
    5. Produce a reviewable change description.

    Common methods for improving this capability include:

    • Using tests as rewards: Unit tests, integration tests, and static analysis can provide process-level rewards and reduce patches that look correct but do not run.
    • Providing repository-level context: Symbol indexes, call graphs, and change sets are generally more useful than placing an entire repository into the context window without structure.
    • Learning from failed trajectories: Compilation errors, timeouts, and permission denials are valuable negative examples for rejection sampling or process supervision.
    • Adding human-in-the-loop controls: Require diff reviews, prohibit direct changes to production configuration, and enforce policy checks for dangerous APIs.

    In a cloud deployment, teams typically connect source repositories, build artifacts in object storage, isolated runtimes on a container platform, and logging and monitoring services into one pipeline. The model executes only inside an isolated environment, and its artifacts pass through policy gates before entering a human or automated release process.

    This design is independent of any particular cloud provider. It is a baseline requirement for engineering safety.

    Security Capabilities: Emergence, Boundaries, and Evaluation Ethics

    When a model is trained through reinforcement learning across many “attackable and verifiable” environments, security-related behavior may appear to improve suddenly. The model may become better at recognizing vulnerability patterns, constructing reproduction steps, or writing defensive patches and detection rules.

    Several principles are essential:

    • Evaluations should serve defense: Use authorized environments to reproduce known vulnerability classes, generate fixes and regression tests, and support code review. Do not provide attack instructions for unauthorized targets.
    • Environments must be isolated: Use only authorized test ranges, sanitized samples, and synthetic vulnerabilities. Real production systems must never be treated as training playgrounds.
    • Separate capability from intent: A model’s ability to explain a vulnerability mechanism does not authorize it to exploit that vulnerability. Product controls must restrict dangerous tool chains through policy enforcement, audit logs, and least-privilege access.

    A security evaluation suite—effectively a cyber range with automatically verifiable success conditions—may produce higher scores as its scale increases. However, the improvement may reflect broader vulnerability coverage, stricter or more accurate judging scripts, or the model becoming better at optimizing for the test.

    Reports should therefore include false-positive and false-negative rates, generalization across vulnerability categories, and the extent to which results depend on leaked clues in the prompt.

    Sandbox Scaling: Moving Scaling Laws into the Environment

    One useful idea is that increasing the number of interactive environments by an order of magnitude can systematically improve agent performance even when the core architecture remains unchanged. This can be understood as an environment-side scaling law: sandbox scaling.

    Its mechanisms are relatively straightforward:

    • Broader coverage: More languages, frameworks, build systems, and failure modes reduce overfitting to a small set of benchmark tasks.
    • Denser rewards: Each trajectory can receive feedback from compilers, tests, and policy engines, producing more stable training signals.
    • Curriculum learning: Tasks can progress from single-file fixes to multi-module refactoring, and from read-only auditing to constrained write operations, gradually extending the planning horizon.
    • Greater parallelism: Sandboxes can scale horizontally, so post-training throughput is no longer limited by the pace of manually authored demonstrations.

    The quality of environments matters more than the number attached to them. Low-fidelity environments—such as mocks that always succeed or fake tests unrelated to real builds—can train agents to exploit scoring strategies instead of solving tasks.

    Environment versions should be documented alongside model versions. Operating systems, compilers, dependency lockfiles, network policies, and resource quotas should all be reproducible.

    A simplified training loop can be represented as follows:

    1. for each task in sandbox_pool:
    2. traj = agent.act(task, tools, budget)
    3. reward = verifier.compile(traj) + tests(traj) + policy_penalty(traj)
    4. update(policy, traj, reward)

    The policy_penalty must include hard constraints for unauthorized access, sensitive-data exfiltration, destructive commands, and other unsafe behavior. Otherwise, harmful actions may become high-reward shortcuts.

    How to Interpret Claims That a Smaller Model Beat a Larger One

    When a model with fewer parameters achieves a higher score, use the following checklist:

    • Is the evaluation public?
    • Are additional tools or retrieval allowed?
    • Does the context exceed the stated evaluation limit?
    • Was post-training directly optimized for the same benchmark suite?
    • Is there a risk of overfitting?
    • Are inference-time compute budgets equivalent, including sampling count, search width, and self-consistency?
    • Are safety and compliance metrics included in the final score, or is the result based only on a narrow metric such as attack success rate?

    Only comparable evaluation protocols support conclusions about post-training efficiency or environment scaling. Otherwise, the comparison may simply reflect unequal compute, tools, or prompting.

    Recommendations for Enterprise Deployment

    1. Define the task loop before choosing model specifications: Use automatically verifiable internal tasks, such as fixing a known defect and passing the test suite, rather than relying only on public benchmarks.
    2. Treat sandboxes as first-class components: Release environment images with model versions, and log and monitor every tool call.
    3. Govern post-training data: Trajectories should be authorized, de-identified, and revocable. Security-related data should remain focused on defense and remediation.
    4. Use layered permissions: Separate development, staging, and production. Default the model to no network access or allow only approved destinations. Manage secrets through a centralized credential system rather than putting them in prompts.
    5. Continuously compare architecture and training investments: New architectures are worth tracking, but production teams can use a stable backbone with stronger post-training to maintain delivery reliability. Switch architectures after their practical benefits have been validated.

    Conclusion

    Improvements in coding and security capabilities increasingly resemble reinforcement learning in verifiable environments rather than a competition based solely on pretraining parameters.

    Architecture upgrades, post-training intensity, and sandbox scale are three levers that can be adjusted independently. For engineering teams, the most valuable work is to define evaluation protocols clearly, build realistic environments, keep dangerous capabilities inside authorized test ranges, and use regression gates to verify reliability under real-world constraints.

    Scaling laws have not disappeared. They are now also expressed through the number of trajectories, verifiers, and isolated environments.