Urgent.News

What's breaking now, across hundreds of outlets.

AI

Your AI Agent Wrote Code. Where Does It Run? A Sandbox Runner in Under 50 Lines of Python

Your AI agent just wrote some Python and wants to run it. Where does that code actually execute? For a lot of agent products the honest answer is "on the same server as everything else, with the same environment variables". That means the same API keys, the same database URL and the same network access as your app. One bad generation, or one prompt injection hidden in a document the agent read,…

A sandbox runner for untrusted AI-generated code can be implemented in under 50 lines of Python. This runner isolates the code from the host environment and enforces strict limits to prevent potential security breaches. The code defines a set of limits for CPU usage, memory usage, file size, wall clock time, and output size. It also sets a safe environment with restricted PATH, LANG, and HOME variables.

The runner uses the subprocess module to execute the agent's code in a separate process group, ensuring that any timeouts or errors are properly handled. By limiting the resources and isolating the code, this runner provides a basic level of security for running potentially malicious AI-generated code.

Rewritten by urgent.news; may contain errors — check the original.

Read the original at dev.to →

Report a problem with this story

More in AI

Gemini 4 Neon Costs More Per Token and Less Per Task

Carbon costs $2 per million input tokens. Neon costs $3 per million input tokens. Same family, same 1M context window, and the cheaper one has the higher price tag.

  • Gemini 4 Neon launched on November 18, 2026, as a "frontier-level intelligence at lower cost"
  • Higher price per token compared to Carbon predecessor, causing user confusion
  • Neon excels in complex tasks like legal research and tax analysis, but falls short in Code Migration

Upscaling AI-Generated Video to 4K: Resolution, Bitrate, Frame Rate and Artifacts

Disclosure: I'm writing this as part of the VideoUpscalerAI team. The product-specific numbers below come from our own published docs, and the rest is general video engineering that applies to any…

  • 4K upscaling requires consideration of resolution, bitrate, frame rate and artifacts
  • Integer scale factors (2×) are cleaner than higher fixed factors
  • Generated footage often shows artifacts like smeared textures and blocky compression

Agentic AI for Payment Exceptions in LangGraph: Deadline Triage, Sanctions Hits & a Release the LLM Must Never Make

Payments is the domain where "the happy path is already automated" is most literally true — straight-through processing has existed for decades, and a clean payment never touches a human.

  • Agent classifies exception types and urgency using a small model
  • Escalates high-value exceptions with <30 minutes remaining deadline
  • Drafts discrimination narrative for sanctions hits but cannot clear false positives

More from Saturday 21 November →