AI Functions: Runtime Code Generation with Automated Verification

AI Functions is a new project from Strands Labs built on the Strands Agents SDK that enables runtime AI code generation with continuous automated verification. Instead of just generating text for humans to integrate, it produces code that runs inside your application at call time, returning native Python objects like DataFrames, Pydantic models, or database connections.
How AI Functions Work
The core abstraction is the @ai_function decorator. You write a Python function with a natural language specification in the docstring instead of implementation code. When the function is called, the decorator intercepts the call, constructs a prompt from the docstring (substituting arguments), sends it to an LLM, executes the generated code in your Python process, and returns the result as a native object.
Here's the basic example from the source:
from ai_functions import ai_function
@ai_function
def translate_text(text: str, lang: str) -> str:
"""
Translate the text below to the following language: {lang}.
{text}
"""
result = translate_text("The quarterly results exceeded expectations.", lang="French")
Key Differentiator: Automated Verification
The critical feature is post-conditions – plain Python assertions that define what correct output looks like. These execute on every function call, not just before deployment. If verification fails, the system automatically retries with the error as feedback. The human never inspects the generated code; the post-conditions handle verification every time.
Software 3.1 Concept
The article positions this as "Software 3.1" – an evolution from Andrej Karpathy's framework where Software 3.0 is "human prompts, LLM generates, human verifies." AI Functions represent "human specifies, LLM generates and executes, machine verifies – at runtime." The execution model differs fundamentally: the LLM isn't producing text for human integration but code that runs directly in your application.
This changes three aspects simultaneously: where AI fits in your software (runtime instead of just development time), what it produces (live objects you can call methods on instead of serialized text), and how you trust it (continuous automated verification instead of one-time human review).
📖 Read the full source: HN AI Agents
👀 See Also

Rukuzu: Porting a 200,000 Line C++ Graph Database to Rust with Systematic Testing
The Rukuzu project describes a workflow for porting the 200,000-line C++ kuzu embedded graph database to Rust, using a Claude Code custom command to maintain both versions simultaneously and verify correctness through 2,700+ tests.

OpenTabs: MCP Server with 100+ Plugins for Browser-Based AI Tool Access
OpenTabs is an MCP server and Chrome extension that exposes 100+ plugins with ~2,000 tools by hooking into web apps' internal APIs like Slack, Discord, and GitHub. It works with existing browser sessions, eliminating API keys and OAuth flows.

Ollama Update Adds OpenClaw Support for Kimi k2.5 Cloud Model
Ollama has released an update that integrates OpenClaw support for cloud models, including free access to the Kimi k2.5 model with web search functionality, running on NVIDIA data centers.

Claude Ops: Browser Dashboard for Claude Code Live Status and Subagent Tracking
A free, local macOS browser dashboard that tracks Claude Code session live status, current tool, spawned subagents, and sends OS push notifications when input is needed.