Skip to main content
Elastic Copilot’s auto approve feature allows you to automatically approve and execute certain types of commands and code suggestions, streamlining your development workflow.

How It Works

Auto approve enables Elastic Copilot to execute pre-approved actions without requiring manual confirmation for each operation. This feature is designed to speed up repetitive tasks while maintaining safety through configurable rules.

Safe Operations

Automatically approved actions
  • File reading and analysis
  • Code formatting and linting
  • Documentation generation
  • Simple refactoring operations

Manual Approval

Always requires confirmation
  • File deletion or major changes
  • System configuration modifications
  • External API calls
  • Database operations

Configuration Options

Basic Settings

1

Enable Auto Approve

Open VSCode settings and search for “elastic.autoApproval.enabled”
2

Set Approval Rules

Configure which types of operations should be auto-approved
3

Define Exclusions

Specify files or directories that should always require manual approval

Advanced Configuration

{
  "elastic.autoApproval.fileOperations": {
    "read": true,
    "write": false,
    "delete": false,
    "create": true
  }
}
{
  "elastic.autoApproval.commands": {
    "build": true,
    "test": true,
    "deploy": false,
    "install": false
  }
}
{
  "elastic.autoApproval.projectRules": {
    "excludeDirectories": ["node_modules", ".git", "build"],
    "excludeFiles": ["*.env", "*.key", "*.pem"]
  }
}

Safety Features

Built-in Protections

High-Risk Operations: Auto approve never applies to operations that could cause data loss or security issues.
Audit Trail: All auto-approved actions are logged for review and debugging purposes.
Gradual Enablement: Start with conservative settings and gradually expand auto approve as you become comfortable with the feature.

Best Practices

Development Environment

Enable auto approve for code analysis, formatting, and documentation tasks

Production Environment

Disable auto approve for deployment and system configuration changes

Team Projects

Use consistent auto approve settings across team members

Security Considerations

Always exclude configuration files, credentials, and deployment scripts from auto approve
Be cautious with auto-approving operations that involve external APIs or services
Regularly review auto approve logs to ensure the feature is working as expected

Troubleshooting

Common Issues

  • Check that auto approve is enabled in settings
  • Verify the command type is configured for auto approve
  • Ensure the file/directory isn’t in the exclusion list
  • Review your auto approve rules configuration
  • Check for overly broad inclusion patterns
  • Consider tightening the approval criteria
  • Reduce the scope of auto-approved operations
  • Add more specific exclusion rules
  • Consider disabling auto approve for large projects