Close Menu
IOupdate | IT News and SelfhostingIOupdate | IT News and Selfhosting
  • Home
  • News
  • Blog
  • Selfhosting
  • AI
  • Linux
  • Cyber Security
  • Gadgets
  • Gaming

Subscribe to Updates

Get the latest creative news from ioupdate about Tech trends, Gaming and Gadgets.

What's Hot

I Finally Found a Docker Backup Tool That Fits a Home Lab

June 22, 2026

Self-Signed SSL Certificate for Apache on Rocky Linux 10

June 22, 2026

Build an agent that writes its own tools

June 22, 2026
Facebook X (Twitter) Instagram
Facebook Mastodon Bluesky Reddit
IOupdate | IT News and SelfhostingIOupdate | IT News and Selfhosting
  • Home
  • News
  • Blog
  • Selfhosting
  • AI
  • Linux
  • Cyber Security
  • Gadgets
  • Gaming
IOupdate | IT News and SelfhostingIOupdate | IT News and Selfhosting
Home»Artificial Intelligence»Build an agent that writes its own tools
Artificial Intelligence

Build an agent that writes its own tools

AndyBy AndyJune 22, 2026No Comments11 Mins Read
Build an agent that writes its own tools


Revolutionizing AI Agent Integration: Dynamic Tool Generation in a Secure Sandbox

The landscape of Artificial Intelligence is rapidly evolving, pushing the boundaries of what AI agents can achieve. However, a significant bottleneck has emerged: the constant struggle to integrate these sophisticated agents with external systems through static, pre-built tools. This often leads to brittle, high-maintenance solutions that hinder scalability and innovation. This article delves into a revolutionary pattern—the Natural Language (NL) agent—that inverts this traditional approach. Discover how AI agents can dynamically author their own tools on the fly using raw API specifications within a secure, controlled sandbox, unlocking unprecedented flexibility and resilience for complex integrations, especially with the power of modern Large Language Models (LLMs).

The companion GitHub repo can be found here, docs here and you can try the agent live in the hosted playground.

The Bottleneck in AI Agent Development: Beyond Static Tooling

For too long, the limiting factor in deploying sophisticated AI agents hasn’t been the agent framework itself, but the tedious and error-prone process of external system integration. The conventional model relies on an “agent plus curated tool registry.” Every new external system requires a bespoke tool wrapper, an MCP server, and an entry in a registry that perpetually lags behind the API it’s supposed to interface with.

This approach scales linearly with the number of integrations, creating a permanent curation burden. A wrapper is shipped, the vendor updates their endpoint, the wrapper drifts, the agent breaks, and the cycle of updates begins anew. This constant maintenance overhead diverts valuable engineering resources from core AI development to managing integration glue code.

Introducing the Natural Language Agent Paradigm: Dynamic Tool Generation

A transformative pattern is emerging in production environments that fundamentally inverts this model: the “agent plus secure sandbox plus raw API specs.” In this paradigm, tools are not pre-built artifacts. Instead, the agent writes them dynamically, on the fly, referencing only the raw API specification. These ephemeral tools are then executed within a trusted, secure boundary, and discarded if they prove incorrect or unneeded. The framework’s primary role shifts from providing a static toolkit to making the act of tool-authoring safe and efficient for autonomous agents.

A Practical Demonstration: Cleaning Up Monorepo Codeownership

Luke Shulman, Director of Agent Innovation at DataRobot, recently showcased this pattern in a Build Club session. The challenge, proposed by the audience, involved automating CODEOWNERS hygiene within DataRobot’s monorepo—a common issue where outdated team aliases accumulate. The task was clear: scan the repo, identify files owned by non-existent teams, propose reassignments, and open a pull request.

Luke built this solution live in just an hour, utilizing a modest 35B-parameter model. Crucially, not a single tool was pre-built. The agent, leveraging the GitHub OpenAPI specification, authored every necessary tool itself, demonstrating the unparalleled agility and self-sufficiency of this approach.

Engineering the NL Agent: Architecture and Implementation

This revolutionary approach, which Luke terms a Natural Language (NL) agent (also known as a context-agent), fundamentally reframes where engineering effort is concentrated. Instead of maintaining an extensive tool registry, focus shifts to engineering a robust and secure sandbox environment.

The Power of the Sandbox: Deno’s Role in Secure Execution

The agent operates within a Deno-based JavaScript Virtual Machine, meticulously configured with stringent restrictions: a confined directory, a tightly controlled network allowlist, and a limited set of environment variables. JavaScript is an ideal execution surface due to its inherent browser ecosystem, which is purpose-built for safely running untrusted code. Deno further fortifies this by requiring explicit permissions for file, network, and environment access, creating an unassailable execution boundary.

Initially, the agent is equipped with a minimal set of eight foundational tools: cat, find, grep, tree, write, search-and-replace, mkdir, and critically, execute_code. The execute_code tool is the lynchpin, empowering the agent to read markdown system prompts and reference documentation, then dynamically write JavaScript functions to interact with external systems. It iteratively tries these functions, corrects them upon failure, and persists successful ones as a tools.js file. This means that upon subsequent loads, the agent already possesses these self-authored tools.

This asymmetric advantage is profound: minimal setup, lightweight infrastructure, and the agent performs its own integration against API specifications that are inherently more comprehensive and up-to-date than any human-maintained wrapper. The system doesn’t need to anticipate the agent’s needs; the API spec already provides the necessary context.

The Recipe for Success: Step-by-Step Implementation

The following steps outline the implementation, assuming access to the open-sourced NL agent runtime (github.com/kindofluke/context-agent) and a DataRobot account.

Step 1: Setting Up the Secure Environment

Begin by creating a fresh, isolated working directory—the agent’s sole domain for reading and writing. Configure the Deno sandbox to allow only .js and .md file types within this directory. Critically, establish a network allowlist that permits connectivity exclusively to necessary domains, such as api.github.com for this specific build. This is the foundational security measure; without a safe execution environment, entrusting an agent with code-writing capabilities is a significant risk.

Step 2: Context is King: Integrating Raw API Specs

Download the GitHub OpenAPI specification and place it directly into the agent’s working directory as github-openapi.yaml. Resist the conventional urge to write wrappers or pre-author tools. The raw spec provides all the necessary context. This step is often met with resistance but is vital. Instead of developing a thin client, the NL pattern empowers the agent to author its own, precisely tailored client for only the endpoints it actually needs, avoiding the bloat of unused wrapper surface area.

Step 3: Secure Credential Management

Generate a fine-grained GitHub personal access token with the absolute minimum required scope (e.g., Contents: read and Pull requests: write for the target repo). The NL runtime securely exposes environment variables to the agent only if they carry a specific prefix (e.g., NL_). This ensures sensitive credentials remain invisible to the agent unless explicitly intended, setting NL_GITHUB_TOKEN=your_token makes it accessible while safeguarding other shell variables.

Step 4: Scoped Tasking and Emergent Memory

Initiate interaction via a chat interface, informing the agent of its access and requesting connectivity confirmation. The agent’s first action will be to author a “probe tool”—a small JavaScript function to test an API endpoint like the rate-limit endpoint. Once connectivity is verified, assign the primary task: “find every file in the monorepo owned by @datarobot/cloud-operations in the DR_CODEOWNERS file.”

The agent will then dynamically author a tool, perhaps named getCodeownersFiles, to traverse the repository via the GitHub API, parse CODEOWNERS patterns, and return a list. Remarkably, it will then, unprompted, write a second tool to persist this list as cloud-ops-inventory.txt in its directory. This “tools-as-emergent-memory” pattern naturally arises from the runtime, showcasing the agent’s ability to self-optimize its workflow.

Recent Example: In a similar vein, Google’s AI Test Kitchen explored “tool-making LLMs” where models generated their own functions to interact with external APIs based on user prompts. This directly aligns with the NL agent’s on-the-fly tool generation principle, demonstrating a growing trend towards self-sufficient, context-aware AI.

Step 5: Implementing Scope Discipline with System Prompts

Before allowing the agent to propose repository changes, it’s crucial to mitigate its default tendency to over-perform. Introduce a strict system prompt that clearly delineates its modification boundaries: “The CODEOWNERS guidelines only update CODEOWNERS references. Do not modify real running code. Only open PRs. Be safe.” This directive prevents the agent from “helpfully” refactoring unrelated code. For write access to production repositories, scope discipline is paramount. The agent then processes the inventory file, proposing reassignments based on git history and flagging ambiguous cases for human review, keeping the PR creation within a human-supervised loop for initial passes.

Step 6: Locking Down for Production: Read-Only Artifacts

Once the agent has successfully authored and validated its tools, transition the runtime into read-only mode. In this state, the agent can still invoke its existing tools, read files, and execute previously written JavaScript, but it cannot author new tools or modify its system prompt. The agent transforms into a frozen, deployable artifact. The resultant tools.js and markdown system prompt constitute the entire deliverable. These can then be integrated into a platform like the DataRobot registry and workshop as a custom model, providing a governed, fully visible, and auditable agent.

Key Takeaways for Building Future-Ready AI Agents

The live session highlighted critical insights for developing enterprise-ready AI agents, emphasizing a paradigm shift in platform design.

Prioritizing Context Over Curated Tools

What truly matters is the context you provide. A comprehensive, well-structured API specification consistently outperforms hand-rolled tool wrappers because the spec preserves optionality that wrappers often discard. This implies an uncomfortable truth for product teams: the most impactful contribution to the agentic era isn’t a new SDK or tool registry, but rather exceptional, agent-friendly documentation. The “copy page as markdown” feature now appearing in open-source projects isn’t a mere UX enhancement; it acknowledges that the reader is increasingly an agent. Make your documentation loadable, publish and maintain your OpenAPI specs, and the agents will handle the rest.

The Sandbox as the True Unlock

While many agent frameworks focus on orchestration, memory, and planning, the decisive factor for shipping the NL pattern is the ability to provide a genuinely trustworthy execution environment. Deno’s permission model addresses this with restricted file types, directories, network egress, and prefixed environment variables. These seemingly simple controls are non-negotiable prerequisites before the sophistication of the agent’s reasoning loop becomes relevant.

Documentation Quality Trumps Framework Complexity

The most effective autonomous agents in production are not those with the most elaborate orchestration, but those surrounded by the cleanest, most loadable, and agent-friendly documentation. Every minute invested in improving markdown quality is arguably more valuable than ten minutes spent on developing a more complex agent framework. Many teams invert these priorities, leading to agents that dazzle in demonstrations but falter in real-world deployment.

Implications for Enterprise AI Platforms

For platforms like DataRobot, the implications are direct. By extending existing custom model registries to accommodate only a tools.js file and a markdown system prompt, with the NL runtime providing the secure sandbox underneath, the process simplifies dramatically. This creates a workflow where the agent self-assembles what it needs from a pointed-to specification, operates within a security-approved boundary, and ships as a frozen, reliable artifact upon successful completion. This approach ushers in a new era of agile, secure, and highly adaptable AI agent deployments.

Build Club continues weekly, offering live, unrehearsed builds that break and get fixed in real-time. It’s an invaluable resource for anyone building on DataRobot or exploring enterprise-ready agent solutions.

FAQ

Question 1: What exactly is a Natural Language (NL) agent in this context?

Answer 1: A Natural Language (NL) agent, also referred to as a context-agent, is a type of AI agent—often powered by Large Language Models (LLMs)—that is capable of dynamically writing its own tools on the fly. Instead of relying on a pre-built, static tool registry, it uses raw API specifications (like OpenAPI) as its primary context to generate JavaScript functions. These functions are then executed within a secure, sandboxed environment to interact with external systems. This allows the agent to adapt quickly to new APIs and tasks without human-engineered wrappers.

Question 2: How does this approach enhance security compared to traditional AI agent methods?

Answer 2: This NL agent pattern significantly enhances security through its reliance on a secure sandbox and fine-grained access controls. The Deno-based JavaScript VM isolates the agent’s execution, restricting its access to only specific directories, file types, network domains, and prefixed environment variables. This prevents the agent from accessing unauthorized resources or performing malicious operations. Furthermore, by allowing the agent to write its own tools *within* this sandbox, rather than integrating pre-built, potentially vulnerable wrappers, the attack surface is minimized and controlled, making it much safer for deploying autonomous agents in production.

Question 3: What are the main benefits for developers and enterprises adopting this dynamic tool generation for AI agents?

Answer 3: The main benefits are significantly increased agility, reduced maintenance overhead, and enhanced scalability. For developers, it eliminates the tedious work of writing and maintaining tool wrappers, allowing them to focus on core agent logic and problem-solving. For enterprises, it means faster integration with new systems, as agents can adapt to new APIs instantly using their specs. This paradigm also future-proofs solutions, making them resilient to API changes and reducing technical debt. Ultimately, it enables the deployment of more robust and adaptable AI agents that can operate more autonomously and effectively across diverse enterprise environments, leading to more efficient autonomous agents and better utilization of Large Language Models (LLMs).



Read the original article

0 Like this
agent build Tools writes
Share. Facebook LinkedIn Email Bluesky Reddit WhatsApp Threads Copy Link Twitter
Previous ArticleHow to Install Ubuntu 26.04 LTS on Bare Metal – Linux Hint
Next Article Self-Signed SSL Certificate for Apache on Rocky Linux 10

Related Posts

Artificial Intelligence

The Roadmap to Mastering AI Agent Evaluation

June 22, 2026
Artificial Intelligence

Should employees be worried that training AI tools could mean they teach the software how to do their jobs?

May 22, 2026
Artificial Intelligence

DataRobot for Developers: Skills, MCP, and the agentic developer surface

May 22, 2026
Add A Comment
Leave A Reply Cancel Reply

Top Posts

AI Developers Look Beyond Chain-of-Thought Prompting

May 9, 202515 Views

6 Reasons Not to Use US Internet Services Under Trump Anymore – An EU Perspective

April 21, 202512 Views

Andy’s Tech

April 19, 20259 Views
Stay In Touch
  • Facebook
  • Mastodon
  • Bluesky
  • Reddit

Subscribe to Updates

Get the latest creative news from ioupdate about Tech trends, Gaming and Gadgets.

About Us

Welcome to IOupdate — your trusted source for the latest in IT news and self-hosting insights. At IOupdate, we are a dedicated team of technology enthusiasts committed to delivering timely and relevant information in the ever-evolving world of information technology. Our passion lies in exploring the realms of self-hosting, open-source solutions, and the broader IT landscape.

Most Popular

AI Developers Look Beyond Chain-of-Thought Prompting

May 9, 202515 Views

6 Reasons Not to Use US Internet Services Under Trump Anymore – An EU Perspective

April 21, 202512 Views

Subscribe to Updates

Facebook Mastodon Bluesky Reddit
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions
© 2026 ioupdate. All Right Reserved.

Type above and press Enter to search. Press Esc to cancel.