Skip to main content
Environment configuration works in two layers:
  1. Default Configuration: Your project’s baseline environment that all agents start from
  2. Agent Adaptations: Changes agents make during work (ephemeral until imported)
Configuration changes only apply to new environments. Agent modifications remain in their environment until you import them with container-use config import.

The Configuration Workflow

1

Set Default Configuration

Configure your project’s baseline environment that all agents will start from
2

Agent Starts with Defaults

When an agent creates a new environment, it begins with your default configuration
3

Agent Adapts as Needed

During work, the agent may modify its environment configuration - adding tools, changing base images, or setting variables
4

View Agent Changes

Use container-use config show <env> to see what configuration changes the agent made
5

Import Useful Changes

Use container-use config import <env> to adopt the agent’s configuration improvements as your new defaults

Default Configuration

Configure the baseline environment that all agents will start from when working on your project. Instead of using the generic environment, you can specify exactly what base image, dependencies, and setup your project needs as defaults. By default, environments use Ubuntu 24.04 with standard tools (git, curl, bash, apt).

Example: Python Project

To customize for your project:
Now all new agent environments will start with Python 3.11, your dependencies pre-installed, and environment variables configured.

Working with Configurations

Agents can modify their environment during work - installing tools, changing settings, or adapting to specific tasks. These changes are ephemeral until you import them.

View Configurations

Import Agent Changes

When agents make useful changes, import them as your new defaults:

Configuration Commands

Base Image

Using custom images: If you use custom base images with latest tags and update them frequently, consider using versioned tags (e.g., myimage:v1.2.3) for more predictable cache behavior.

Setup Commands

Run after pulling base image, before copying code:

Install Commands

Run after copying code:

Environment Variables

Secrets

Configure secure access to API keys and credentials. See the complete secrets guide for all secret types and examples.

Configuration Storage

Configuration is stored in .container-use/environment.json. Commit this directory to share setup with your team.

Troubleshooting

If environment creation fails, check logs and fix the problematic command:

Next Steps

Environment Workflow

Learn how to work with the environments agents create

Agent Integrations

Set up your coding agent to work with Container Use