You can configure the sandbox environment using either a DevFile or a Dockerfile. Both define your development environment configuration, including dependencies, build commands, and runtime requirements.
Kiro autonomous agent looks for configuration files in the root of your repository:
devfile.yaml or .devfile.yaml for DevFile configurationDockerfile for Docker-based configurationIf found, the agent automatically configures the sandbox based on these specifications, ensuring the environment matches your project's requirements.
DevFiles let you specify:
Here's a basic DevFile for a Node.js project:
schemaVersion: 2.2.0 metadata: name: nodejs-app version: 1.0.0 components: - name: runtime container: image: node:18 memoryLimit: 1024Mi mountSources: true commands: - id: install exec: component: runtime commandLine: npm install workingDir: ${PROJECT_SOURCE} - id: run exec: component: runtime commandLine: npm start workingDir: ${PROJECT_SOURCE} - id: test exec: component: runtime commandLine: npm test workingDir: ${PROJECT_SOURCE}
See the devfile-samples repository for examples of DevFiles across different languages and frameworks.
You can also use a standard Dockerfile to configure the sandbox environment. The agent will build and use the Docker image defined in your Dockerfile.
Example Dockerfile:
FROM node:18 WORKDIR /app # Install dependencies COPY package*.json ./ RUN npm install # Copy application code COPY . . # Set environment variables ENV NODE_ENV=production # Expose port EXPOSE 3000 # Start command CMD ["npm", "start"]
Environment Configuration