Documentation Index
Fetch the complete documentation index at: https://docs.runloop.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Agents API allows you to create, manage, and deploy AI agents on the Runloop platform. Agents can be sourced from Git repositories, npm packages, PyPI packages, or Runloop Objects. Once created, agents can be mounted to Devboxes and used in your workflows.Why Use Agent Objects?
Registering an agent with the Agents API gives you control over how agents are installed, versioned, and distributed. There are three common motivations: Fast, reliable installs. Every time a devbox starts, the agent needs to be ready. Downloading dependencies from external servers on every launch introduces latency and risk — package registries can be slow, rate-limited, or temporarily unavailable. Object-based agents solve this by bundling everything into a pre-packaged archive stored on Runloop, eliminating wide-area network traffic entirely. Git and package-based agents still fetch from upstream servers, but registering them as Runloop agents caches metadata and streamlines the install process. Explicit version control. You want to know exactly which version of an agent is running. Each source type supports this differently:- Git agents can pin to a specific branch or tag via the
reffield - npm/pip agents use standard lock files (
package-lock.json,requirements.txtwith pinned versions) to freeze the dependency tree - Object-based agents are inherently immutable — the archive you upload is exactly what gets installed
Agent Source Types
Runloop supports four types of agent sources. Choose the one that best matches how your agent is developed, versioned, and deployed.| Source Type | Description | Best For |
|---|---|---|
| Git | Clone from a Git repository | Agents in active development, or when you need to target a specific branch or commit |
| npm | Install from npm registry | Node.js agents with stable, versioned releases on npm |
| pip | Install from PyPI | Python agents with stable, versioned releases on PyPI |
| Object | Unpack from a Runloop storage object | Pre-packaged bundles, compiled agents, or production workloads needing fast deterministic startup |
Creating Agents
Creating an Agent from a Git Repository
Create an agent by cloning a Git repository. This is ideal for custom agents or open source agents hosted on GitHub.Creating an Agent from an npm Package
Create an agent from an npm package. The package will be installed globally when the devbox is created. Use the top-levelversion field to pin a specific package version — when omitted, the latest version from the registry is installed.
Creating an Agent from a PyPI Package
Create an agent from a PyPI package. The package will be installed globally when the devbox is created. Use the top-levelversion field to pin a specific package version — when omitted, the latest version from the registry is installed.
Creating an Agent from a Storage Object
Create an agent from a Runloop Object. This is useful for pre-packaged agent bundles, custom builds, or agents that require specific file structures.Before creating an object-based agent, you need to upload your agent files as a Runloop Object. See the Runloop Objects documentation for details on creating objects.
Step 1: Upload Agent Files as a Runloop Object
First, package your agent files and upload them as an object. You can upload a tar archive (.tar, .tar.gz, .tgz) or a single file.
Setup Command Working Directory
The working directory foragent_setup commands depends on the object’s content type:
| Content Type | Working Directory | Example |
|---|---|---|
| Single files (binary, text, gzip, etc.) | The parent directory of agent_path | If agent_path is /home/user/agent.bin, commands run in /home/user/ |
.tar, .tar.gz, .tgz | The agent_path itself (the extracted directory) | Commands run inside the unpacked archive |
git agents | The agent_path itself (the extracted directory) | Commands run inside the git repository |
agent_setup commands.
Step 2: Create Agent from Runloop Object
Once you have the object ID, create an agent using the object source. You can optionally provide setup commands to run after unpacking the object.Complete Example: Creating an Object-Based Agent
Here’s a complete example that packages agent files, uploads them, and creates an agent:Public Agents
Runloop provides ready-to-use public wrappers for popular coding agents like Claude Code, Codex, OpenCode, Gemini CLI, and DeepAgents. You can list all available public agents:Retrieving Agents
Get a Specific Agent
Retrieve details about a specific agent by its ID.Listing Agents
List Your Agents
Retrieve a list of all agents in your account.Agent Versioning
How you control which version of an agent is installed depends on the source type:- Git agents use the
reffield to pin to a specific branch or tag. The top-levelversionfield is not used. - npm/pip agents use the top-level
versionfield to pin the installed package version (e.g.,"2.1.123"). When omitted, the latest version from the registry is installed. - Object agents are inherently immutable — each upload produces a new object ID. The
versionfield is not used.
Using Agents with Devboxes
Once you’ve created an agent, you can mount it onto a Devbox. See the Agent Mounts documentation for details on using agents with Devboxes.Best Practices
Agent Naming
-
Use descriptive names: Choose clear, meaningful names for your agents
- ✅
code-review-agent - ❌
agent1
- ✅
-
Use consistent versioning: For git agents, use meaningful tags as the
ref. For npm/pip agents, useversionto pin the installed package version.
Source Type Selection
- Git: Best for version-controlled agents, custom development, open source agents
- npm: Best for Node.js-based agents available on npm
- pip: Best for Python-based agents available on PyPI
- Object: Best for pre-packaged agents, custom builds, or agents with complex dependencies
Object-Based Agents
- Include setup commands: Use
agent_setupto automate installation and configuration - Check compatibility: Object-based agents are particularly useful when developing agents in compiled languages. Make sure that any compiled binaries work on all target platforms.
Security
- Private repositories: Use authentication tokens for private Git repositories
- Sensitive data: Avoid storing secrets or API keys in agent packages and within Runloop Objects
Related Documentation
- Agent Mounts - Mount agents to Devboxes
- Objects - Upload and manage storage objects
