{
  "id": 3772869,
  "title": "Code Is Open, Secrets Aren't: Organizing Your Project for AI Agents",
  "url": "https://urgent.news/2026/08/27/code-is-open-secrets-arent-organizing-your-project-for-ai-agents",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-27T16:31:26.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/ralvaracode/code-is-open-secrets-arent-organizing-your-project-for-ai-agents-30h0"
  },
  "original_language": "en",
  "account": "This article discusses how to organize a project for AI agents while keeping sensitive information secure. Any information exposed in the frontend or accessible through routes can be seen by users and AI agents. However, secrets such as API keys and credentials should remain on the server-side. The suggested project structure includes separate folders for different environment variables and build scripts.\n\nThe project directory is organized as follows:\n\n- ~/projects\n- my-project\n- back-env\n- .env\n- .env.prod\n- .env.prod.pc\n- builder\n- build.sh\n- front-env\n- .env\n- .env.dev\n- .env.dev.pc\n- .env.prod\n- repos\n- my-project-back\n- .env.example\n- src\n- my-project-front\n- .env.example\n- src\n\nThe main concept is to grant AI agents access to the code repositories while keeping the .env files in higher-level directories to maintain their privacy. Frontend files require building, necessitating multiple .env files depending on the deployment environment. To address this, environment files are organized in their respective folders. Additionally, a build.sh script is used to build the project using the appropriate .env file.",
  "summary": "This Article is also found in Web-Warrior-Toolbox Anything you put in the frontend or expose through routes is visible to users and AI agents, while secrets like API keys and credentials must stay server‑side. In this article I propose organizing your project with clear boundaries to make it obvious what’s safe to expose and what must be hidden, reducing the chance of leaking sensitive data. I…",
  "key_points": [
    "Separate .env files for different environments to secure secrets",
    "AI agents can access code repositories, not .env files",
    "build.sh script builds project using appropriate .env file"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}