Data Security when using coding Agents
I look at some of the data security issues and risks if you're considering using a coding agent - as a developer, or as an organisation.
Cheers, Ronan
Trelis Links:
🤝 Are you a talented developer? Work for Trelis
💡 Need Technical or Market Assistance? Book a Consult Here
💸 Starting a New Project/Venture? Apply for a Trelis Grant
Video Links:
- Cursor Security Deep Research Report: https://chatgpt.com/share/67f6407c-7184-8003-bd60-b45e17258437 (caution: check sources)
- Windsurf Security Deep Research Report: https://chatgpt.com/share/67f640d3-311c-8003-bd37-30a2473dcc52 (caution: check sources)
TIMESTAMPS:
0:00 Is my data at risk using Cursor or Windsurf?
1:34 Leakage of environment variables (passwords) due to .cursorignore failing
2:30 Two ways data can be transferred to Cursor or Windsurf
3:07 Using .cursorignore in Cursor
5:58 Cursor and Windsurf have broad access to your files (no sandboxing)
7:31 .codeiumignore is more robust than .cursorignore for blocking data leakage
9:64 Data risks posed by automated tool calls / agents
10:55 Malicious instructions found while web searching or in code bases
11:56 Cursor Security Docs: .cursorignore is only on a “best effort” basis
13:45 Enabling Privacy mode and Workspace Trust on Cursor
14:53 Disabling snippet telemetry (formerly zero-data?) on Windsurf (workspace trust is the same approach as for cursor)
15:40 Security recommendations for developers and organisations using agents
16:39 Security suggestions for Cursor and Windsurf
17:43 Resources
Security Risks in AI Coding Assistants
Environment Variable Exposure
Cursor and Windsurf present several security concerns around environment variables and sensitive data:
Cursor can expose .env file contents even when included in .cursorignore
Requires terminal restart for .cursorignore changes to take effect
Cursor describes ignore functionality as "best effort" rather than guaranteed protection
Windsurf respects .gitignore and .codeiumignore more consistently
Open windows can expose sensitive data in context regardless of ignore settings
Agent Access and Sandboxing
Current implementations lack proper sandboxing:
Agents can access files outside their working directory
No folder-level restrictions on file access
Tool calls can read/write across the entire filesystem
"YOLO mode" allows unrestricted automated tool execution
Data Transfer Mechanisms
Two primary ways sensitive data can be transmitted:
Context inclusion:
Files open in editor windows
Files not properly ignored
Embedded in prompts
Indexing:
Code indexed for search functionality
Chunks sent for remote embedding calculation
Cursor stores embeddings remotely
Windsurf calculates remotely but stores locally
Recommended Security Measures
For Cursor:
Enable Privacy Mode in settings
Enable Workspace Trust
Restart after .cursorignore changes
Review tool call permissions
For Windsurf:
Disable code snippet telemetry
Use .codeiumignore consistently
Monitor open windows
General Practices:
Use test API keys during development
Rotate production credentials after coding sessions
Avoid deploying directly from AI-assisted sessions
Review security documentation thoroughly
Use separate development environment for unrestricted usage
Areas for Improvement
The tools could benefit from:
Strict folder-level sandboxing
Guaranteed ignore file enforcement
Local-only operation options









