Kiroignore - Features - Docs - Kiro
https://kiro.dev/docs/kiroignore/ • 227 KB fetched Open original page
Kiroignore - Features - Docs - Kiro
Loading image... Product
* About Kiro
* IDE
* CLI
* Web
* Mobile
* Crew
* Pricing
* Downloads
For
* Enterprise
* Startups
* Students
Community
* Overview
* Ambassadors
* Discord
* Events
* Powers
* Shop
* Showcase
Resources
* Docs
* Blog
* Changelog
* FAQs
* Report a bug
* Suggest an idea
* Billing support
Social
*
*
*
*
*
*
*
English
Site Terms License Responsible AI Policy Legal Privacy Policy Cookie Preferences English
Loading image...
* Apps
* CLI
* Web
* Enterprise
* Pricing
* Docs
* Community
* Resources
SIGN IN DOWNLOADS
Loading image...
Get Started
Installation Authentication Your first project
Models
Overview Available models Reasoning effort
Features
How Kiro works Specs
Steering Hooks
MCP
Permissions Custom agents
Agent Skills Powers
Cloud sessions Compaction Kiroignore Checkpoints and rewind Built-in tools
Configuration scopes
IDE 1.x
What's new in 1.0
Setup & First Run Editor
Chat
Experimental
Troubleshooting 0.x reference
CLI
What's new in 3.0
Setup & First Run Terminal UI
Chat
Voice mode Headless mode ACP Auto complete Experimental
2.x reference
Crew
Quick start Installation Running 24/7 Chat
Agent Capabilities
Features
Interfaces
Apps
System & storage Configuration Security Troubleshooting
Web
Setup & First Run Identity Center Connect your repositories
Working with the agent
Autonomous mode Automations Memory Configuration Sync Sandbox
Mobile - Preview
Overview
Commands and Reference
CLI commands Slash commands Built-in tools Exit codes Settings
Billing
Overview Managing your subscription Upgrading your plan Downgrading your plan Cancelling your plan Purchasing add-on credits Managing your payments Managing usage notifications Managing your taxes Contacting billing support Deleting your account Related questions
Enterprise
Concepts Onboarding quickstart Connecting your identity provider
Deployment options Subscribe your team Manage subscriptions Governance
Monitor and track
Settings Managed updates Billing IAM Supported regions
Privacy and Security
Overview Data protection Code references Compliance validation Infrastructure security IAM permissions Firewalls, proxies, and data perimeters VPC endpoints (AWS PrivateLink)
Guides
Overview Language support
Learn by playing
Migration
Migrating from Q Developer Migrating from VSCode Upgrading from Q CLI
* Docs
*
* Features
*
* Kiroignore
Copy page View as Markdown
Kiroignore
Copy page View as Markdown
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.
Where supported, ignore patterns apply across the agent's tools - blocked files stay blocked regardless of which tool tries to read them. Before returning file or text search results, Kiro checks each result against your read permissions and ignore rules. Paths and matching content from ignored or unreadable files do not appear in search results. Check the table below for surface availability.
Capability IDE CLI Web Mobile
Workspace .kiroignore ✓ V3 search — —
Global ignore file ( ~/.kiro/settings/kiroignore ) ✓ — — —
The IDE enforces .kiroignore across supported agent tools. In CLI V3, support is limited to filtering content-search and filename-search results. Web support is not available yet.
Why use .kiroignore?
* Security - Prevent Kiro from accessing files containing credentials, API keys, or other sensitive data
* Privacy - Exclude confidential information from AI interactions
* Compliance - Ensure Kiro doesn't access files that shouldn't be shared with external services
* Focus - Keep Kiro's context relevant by excluding large files or build artifacts
Setting up workspace ignore
To exclude files in a specific project, create a .kiroignore file in your project root (or any subdirectory) and add patterns for files you want to exclude:
bash
# Secrets and credentials
.env
.env.*
! .env.example
*.pem
*.key
# Private directories
secrets/
private/
Kiro skips any files matching your patterns.
IDE CLI
The IDE reads ignore filenames from the Agent Ignore Files setting. Open Settings ( Cmd+, on Mac or Ctrl+, on Windows/Linux), search for Agent Ignore Files (setting: kiroAgent.agentIgnoreFiles ), and add .kiroignore to the array.
The kiroAgent.agentIgnoreFiles setting accepts an array of filenames:
* Use multiple ignore file types simultaneously: [".gitignore", ".kiroignore"]
* Set to [] to disable workspace-level ignore files
Tip
Start with credentials and secrets - these are the highest priority files to protect. You can always expand your patterns as your project evolves.
Subdirectory ignore files
Like .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.
Global ignore files
Kiro automatically honors global ignore files if they exist - no configuration needed:
* ~/.kiro/settings/kiroignore - Your global Kiro ignore patterns
* Git's global ignore file (configured via core.excludesfile in your git config) - only applied in git repositories
Use global ignore files for patterns you want applied across all your projects.
Pattern syntax
.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)
Info
You cannot re-include a file if a parent directory is excluded. For example, if you ignore secrets/ , adding !secrets/public.txt won't work. To include specific files from a directory, use more specific patterns instead of excluding the entire directory.
Examples
Protecting API keys and secrets
bash
# Environment files with credentials
.env
.env.local
.env.production
# Keep the template accessible
! .env.example
# Certificate and key files
*.pem
*.key
*.p12
credentials/
Excluding build artifacts and data files
bash
# Build outputs
dist/
build/
.next/
# Data files
*.sql
*.dump
data/exports/
Team compliance setup
bash
# Customer data directories
customer-data/
pii/
# Audit and compliance docs
compliance/internal/
audit-reports/
Info
Use .kiroignore when you need different rules for agent access vs. version control, or to block files that are tracked in git but shouldn't be read by Kiro.
Best practices
* Use comments to document why files are ignored - helpful for team members
* Test patterns by asking Kiro to read an ignored file - it will indicate access is blocked
* Review patterns periodically as your project structure evolves
* Coordinate with your team on global patterns for consistent behavior across workspaces
Page updated: August 21, 2026
Compaction
Checkpoints and rewind
Links found on this page
- About Kiro [direct]
- IDE [direct]
- CLI [direct]
- Web [direct]
- Mobile [direct]
- Crew [direct]
- Pricing [direct]
- Downloads [direct]
- Enterprise [direct]
- Startups [direct]
- Students [direct]
- Overview [direct]
- Ambassadors [direct]
- Discord [direct]
- Events [direct]
- Powers [direct]
- Shop [direct]
- Showcase [direct]
- Docs [direct]
- Blog [direct]
- Changelog [direct]
- FAQs [direct]
- Report a bug [direct]
- Suggest an idea [direct]
- Billing support [direct]
- Site Terms [direct]
- License [direct]
- Responsible AI Policy [direct]
- Legal [direct]
- Privacy Policy [direct]
- Cookie Preferences [direct]
- Loading image... [direct]
- SIGN IN [direct]
- Installation [direct]
- Authentication [direct]
- Your first project [direct]
- Overview [direct]
- Available models [direct]
- Reasoning effort [direct]
- How Kiro works [direct]
- Specs [direct]
- Steering [direct]
- Hooks [direct]
- MCP [direct]
- Permissions [direct]
- Custom agents [direct]
- Agent Skills [direct]
- Powers [direct]
- Cloud sessions [direct]
- Compaction [direct]
- Checkpoints and rewind [direct]
- Built-in tools [direct]
- Configuration scopes [direct]
- What's new in 1.0 [direct]
- Setup & First Run [direct]
- Editor [direct]
- Chat [direct]
- Experimental [direct]
- Troubleshooting [direct]
- 0.x reference [direct]
- What's new in 3.0 [direct]
- Setup & First Run [direct]
- Terminal UI [direct]
- Chat [direct]
- Voice mode [direct]
- Headless mode [direct]
- ACP [direct]
- Auto complete [direct]
- Experimental [direct]
- 2.x reference [direct]
- Quick start [direct]
- Installation [direct]
- Running 24/7 [direct]
- Chat [direct]
- Agent Capabilities [direct]
- Features [direct]
- Interfaces [direct]
- Apps [direct]
- System & storage [direct]
- Configuration [direct]
|
|