When a language modelLarge language model (LLM)A program trained on a huge amount of text until it predicts the next word of any text. Answers, translations and code come out of that repeated prediction. It does not search the web or remember past conversations unless it is given that explicitly. writes part of your code, you remain responsible for it. The model does not know what sensitive data your app handles, or who may see what, unless you tell it. And it writes plausible code quickly, so it is easy to accept without reading. This chapter is about the habits that protect your project: where secretsSecretA key or password that opens a service in your name. It belongs in an environment variable on the server, and never enters the repository, the conversation or files the model writes. live, what permissionsPermissionsWhat a tool or agent may do without asking you: reading files, running commands or reaching the network. Claude Code asks before anything you have not allowed, so do not approve everything without reading. you give the tool, and how to review what it writes.
Secrets
Keys and passwords belong in environment variablesEnvironment variableA value a program reads from the environment it runs in, not from its code, such as a database address or an API key. It differs between your machine and production without changing the code, and the .env file holding it stays out of the repository. on the serverServerA computer or program that waits for requests and answers them, such as a web server returning pages or a database server. What runs on the server the user cannot see, so secrets and checks belong there., and .env files never enter the repositoryRepositoryThe project's folder with its full history in Git: code, docs and settings. It can be on your machine alone or on a platform such as GitHub, public for everyone to see or private.. Deny Claude CodeClaude CodeA coding tool from Anthropic that runs in the terminal and editor inside your repository: it reads files, runs the commands it is allowed, and writes changes. You steer it with CLAUDE.md, settings, agents, commands and skills. from reading them in settings.json: what it does not read cannot appear in a conversation or a file it writes. In web apps, watch the variables that reach the browser: everything sent to the browser is visible to everyone.
A common mistake
const apiKey = "sk-live-1234"; // move it later
The right way
const apiKey = process.env.PAYMENT_API_KEY; // server only, set in the hosting settings
Permissions
Give the tool only what the task needs. Reading files and running tests is enough for most tasks. Commands such as mass deletion, deployingDeploymentPutting a version of your app on servers users can reach, such as Vercel. It is best done automatically from the main branch after the checks pass, with a one-click way back to the previous version., or changing the productionEnvironmentA place the app runs with its own settings: development on your machine, preview for trying things, production for users. Each has its own variables and database, so do not experiment on production. databaseDatabaseA program that keeps an app's data organised and lasting, and lets it be searched and changed safely even with many users at once. The best-known kind is relational, spoken to in SQL, such as Postgres. should ask you every time. And if you add an MCP serverModel Context Protocol (MCP)An open standard that connects AI tools to data sources and tools through "servers" with one interface. Your project's MCP server in Talqeen gives Claude Code the phases, tasks and their status., know what it can do: your project's server in Talqeen deletes nothing, and its write toolsTool useA model asking to run a function the app describes to it, such as a search or reading a file, with structured arguments. The app runs it and returns the result; the model runs nothing itself. need a tokenTokenThe unit a model reads and writes text in, which may be a word, part of one or a punctuation mark. Prices and context limits are counted in tokens, and Arabic text often needs more tokens than English of the same length. with write scope.
Review what is written
Generated code needs the same review as a new colleague's code, and more. Look especially for these recurring mistakes:
Review checklist
- Every user input is validated on the server, not only in the browser
- Queries use parameters, not strings joined by hand (SQL injection)
- Every page and API route checks who is asking and what they may do
- No password, token or personal data appears in the logs
- New packages the model added actually exist and are known
Prompt injection
If your app sends text a user wrote to a language model, that text may hold instructions trying to change the model's behaviour. Treat user text as data, not as instructions: put it inside clear boundaries, and never give the model permissions the user themselves should not have.
Only the prompt in the box is sent to that site, nothing from your projects.