The .kiroignore file prevents Kiro from reading specific files in your workspace. Using familiar gitignore syntax, you define patterns for files that should remain private—credentials, secrets, or content you prefer to keep out of agent context.
To exclude files in a specific project:
.kiroignore file in your project root (or any subdirectory)# Secrets and credentials .env .env.* !.env.example *.pem *.key # Private directories secrets/ private/
Cmd+, on Mac or Ctrl+, on Windows/Linux)kiroAgent.agentIgnoreFiles).kiroignore to the arrayKiro will now skip any files matching your patterns.
The kiroAgent.agentIgnoreFiles setting accepts an array of filenames:
[".gitignore", ".kiroignore"][] to disable workspace-level ignore filesLike .gitignore, you can place .kiroignore files in subdirectories to override or extend patterns from parent directories. Patterns in subdirectory ignore files take precedence for files within that subdirectory.
Kiro automatically honors global ignore files if they exist—no configuration needed:
~/.kiro/settings/kiroignore - Your global Kiro ignore patternscore.excludesfile in your git config) - only applied in git repositoriesUse global ignore files for patterns you want applied across all your projects.
.kiroignore uses standard gitignore syntax:
| Pattern | Effect |
|---|---|
file.txt | Ignore specific file |
*.log | Ignore by extension |
folder/ | Ignore directory |
**/temp | Ignore in any subdirectory |
!keep.txt | Don't ignore (negation) |
# Environment files with credentials .env .env.local .env.production # Keep the template accessible !.env.example # Certificate and key files *.pem *.key *.p12 credentials/
# Build outputs dist/ build/ .next/ # Data files *.sql *.dump data/exports/
# Customer data directories customer-data/ pii/ # Audit and compliance docs compliance/internal/ audit-reports/
Kiroignore