Skip to content

Add documentation for secrets and sandbox size #1113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"sandboxes/setup-commands",
"sandboxes/editor",
"sandboxes/environment-variables",
"sandboxes/sandbox-size",
"sandboxes/web-preview"
]
},
Expand All @@ -50,6 +51,7 @@
"pages": [
"settings/agent-permissions",
"settings/repo-rules",
"settings/secrets",
"settings/model-configuration"
]
}
Expand Down
129 changes: 129 additions & 0 deletions docs/sandboxes/sandbox-size.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
title: "Sandbox Size"
sidebarTitle: "Sandbox Size"
icon: "expand"
---

Sandbox Size determines the computational resources allocated to your AI agent's execution environment. Different sandbox sizes provide varying levels of CPU, memory, and storage capacity to handle tasks of different complexity and resource requirements.

## Available Sandbox Sizes

Codegen offers multiple sandbox size options to match your workload requirements:

### Small
- **CPU**: 2 vCPUs
- **Memory**: 4 GB RAM
- **Storage**: 20 GB
- **Best for**: Simple code changes, documentation updates, small scripts

### Medium (Default)
- **CPU**: 4 vCPUs
- **Memory**: 8 GB RAM
- **Storage**: 40 GB
- **Best for**: Most development tasks, testing, moderate complexity projects

### Large
- **CPU**: 8 vCPUs
- **Memory**: 16 GB RAM
- **Storage**: 80 GB
- **Best for**: Large codebases, complex builds, data processing tasks

### Extra Large
- **CPU**: 16 vCPUs
- **Memory**: 32 GB RAM
- **Storage**: 160 GB
- **Best for**: Heavy computational tasks, large-scale testing, enterprise applications

## Configuring Sandbox Size

You can configure the sandbox size at different levels:

### Organization Level
Set a default sandbox size for your entire organization:

1. Navigate to [codegen.com/settings/sandboxes](https://codegen.com/settings/sandboxes)
2. Select your preferred default sandbox size
3. Save the configuration

### Repository Level
Override the organization default for specific repositories:

1. Go to [codegen.com/repos](https://codegen.com/repos)
2. Select the repository you want to configure
3. Choose a specific sandbox size for that repository
4. Save your changes

### Task Level
Specify sandbox size when requesting specific tasks:

```
@codegen --sandbox-size=large
Please run the full test suite and generate a performance report
```

## Choosing the Right Size

Consider these factors when selecting a sandbox size:

### Project Characteristics
- **Codebase Size**: Larger repositories may need more storage and memory
- **Build Complexity**: Complex build processes require more CPU and memory
- **Dependencies**: Projects with many dependencies need more storage space
- **Test Suites**: Comprehensive test suites benefit from additional resources

### Task Requirements
- **Code Analysis**: Large-scale analysis tasks need more memory
- **Compilation**: Building large projects requires more CPU
- **Data Processing**: Working with large datasets needs more memory and storage
- **Parallel Operations**: Concurrent tasks benefit from additional CPU cores

## Performance Considerations

### Resource Utilization
- Monitor your tasks to see if they're hitting resource limits
- Upgrade to a larger size if you notice performance bottlenecks
- Downgrade to save costs if resources are consistently underutilized

### Cost Optimization
- Start with the default Medium size for most tasks
- Scale up only when necessary for specific workloads
- Consider repository-specific sizing for different project types

<Tip>
Most development tasks work well with the default Medium sandbox size. Only
upgrade to larger sizes if you're experiencing performance issues or working
with particularly resource-intensive projects.
</Tip>

## Monitoring and Optimization

### Resource Monitoring
The Codegen platform provides insights into:
- CPU utilization during task execution
- Memory usage patterns
- Storage consumption
- Task completion times

### Automatic Recommendations
Based on usage patterns, Codegen may suggest:
- Optimal sandbox sizes for specific repositories
- Cost-saving opportunities through downsizing
- Performance improvements through upsizing

<Note>
Sandbox size changes take effect immediately for new tasks. Running tasks
will continue with their original resource allocation until completion.
</Note>

## Billing and Limits

- Sandbox size affects your usage costs
- Larger sandboxes consume more compute credits
- Organization admins can set limits on maximum sandbox sizes
- Usage reports show resource consumption by sandbox size

<Warning>
Very large sandbox sizes should be used judiciously as they consume
significantly more resources and may impact your usage limits.
</Warning>

70 changes: 70 additions & 0 deletions docs/settings/secrets.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: "Secrets"
sidebarTitle: "Secrets"
icon: "key"
---

<!-- Documentation for secrets management in Codegen -->

Secrets in Codegen allow you to securely store and manage sensitive information like API keys, tokens, and other credentials that your AI agent needs to access during task execution. These secrets are encrypted and made available to the agent's sandbox environment without exposing them in your codebase.

## How Secrets Work

When you configure secrets for your organization, they become available as environment variables within the agent's sandbox environment. This allows the agent to:

- Access external APIs and services
- Authenticate with third-party tools
- Use credentials without hardcoding them in your repository
- Maintain security best practices by keeping sensitive data separate from code

## Accessing and Configuring Secrets

You can manage your organization's secrets through the Codegen web interface:

1. Navigate to [codegen.com/settings/secrets](https://codegen.com/settings/secrets)
2. Add new secrets by providing a name and value
3. Configure which repositories or environments can access specific secrets
4. Save your changes to make them available to the agent

<Note>
Secrets are encrypted at rest and in transit. Only the AI agent's sandbox
environment can access the decrypted values during task execution.
</Note>

## Common Use Cases

Secrets are commonly used for:

- **API Keys**: Store keys for external services like OpenAI, GitHub, or cloud providers
- **Database Credentials**: Securely connect to databases without exposing connection strings
- **Authentication Tokens**: Access private repositories or services that require authentication
- **Configuration Values**: Store environment-specific settings that shouldn't be in code
- **Third-party Integrations**: Credentials for services like Slack, Linear, or other tools

## Best Practices

When working with secrets in Codegen:

- **Use Descriptive Names**: Choose clear, descriptive names for your secrets (e.g., `OPENAI_API_KEY`, `DATABASE_URL`)
- **Rotate Regularly**: Update secrets periodically to maintain security
- **Principle of Least Privilege**: Only grant access to secrets that are actually needed
- **Avoid Duplication**: Don't store the same secret multiple times with different names
- **Document Usage**: Keep track of which secrets are used by which repositories or workflows

<Tip>
The agent will automatically have access to configured secrets as environment
variables. You can reference them in your code using standard environment
variable syntax (e.g., `process.env.API_KEY` in Node.js or `os.getenv('API_KEY')` in Python).
</Tip>

## Security Considerations

- Secrets are never logged or displayed in plain text in the Codegen interface
- Access to secrets is controlled at the organization level
- Secrets are only available within the secure sandbox environment
- All secret operations are audited for security compliance

<Warning>
Never commit secrets directly to your repository. Always use the Codegen
secrets management system to handle sensitive information securely.
</Warning>
Loading