Build an agent that writes its own tools

· Source: Blog | DataRobot · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering, Robotics & Autonomous Systems · Depth: Advanced, medium

Summary

A new "Natural Language (NL) agent" pattern inverts the traditional agent-tool registry model, enabling agents to write their own tools on the fly using raw API specifications within a secure sandbox. Luke Shulman from DataRobot demonstrated this by building an agent in an hour with a modest 35B-parameter model to address `CODEOWNERS` hygiene in a monorepo. The agent operated within a Deno-based JavaScript VM with restricted directory, network, and environment access, starting with basic tools like `cat` and `execute_code`. It then authored specific JavaScript functions against the GitHub OpenAPI spec, persisting successful tools. This approach emphasizes the sandbox's role in safe tool-authoring and the critical importance of well-structured API documentation over complex agent orchestration.

Key takeaway

For AI Engineers or MLOps teams building agents that interact with external systems, consider adopting the "agent plus secure sandbox plus raw API specs" pattern. This approach reduces the burden of maintaining custom tool wrappers by enabling agents to author their own tools on demand. Focus your engineering effort on robust sandbox security and providing comprehensive API documentation, rather than complex agent orchestration, to ensure deployable and governed agent solutions.

Key insights

Agents can safely author their own tools from raw API specs within a secure sandbox, eliminating manual tool wrapper maintenance.

Principles

Method

Set up a restricted Deno-based JavaScript VM sandbox. Provide raw OpenAPI specs and fine-grained API tokens. Give the agent a scoped task, allowing it to author and test JavaScript tools. Implement scope discipline via system prompts. Lock the agent into read-only mode for production.

In practice

Topics

Code references

Best for: AI Engineer, MLOps Engineer, AI Architect

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Blog | DataRobot.