AI-Assisted Coding · Final projectPart 3

Study explanation · Part 03 · 12 min

Secrets and data hygiene

A public repository is a permanent publication. The brief asks you to confirm it holds no secrets, tokens, .env files, credentials, production logs or personal and customer data. This lesson turns that sentence into checks you can run.

Listen to this lesson

Hear the lesson read aloud, with each sentence highlighted as you go.

Narrated by an AI voice.

What the brief rules out

The brief’s third submission bullet: “Confirm the repo contains no real secrets, tokens, .env files, credentials, production logs, or personal/customer data.” Note the word repo, not branch. Because the repository is public and you submit only its URL, anything committed to any branch, at any point in its history, is part of what you publish.

  • Secrets and tokens API keys, access tokens, signing keys, passwords.
  • .env files Local environment files, even if they look harmless today.
  • Credentials Private keys, certificates, service-account files.
  • Production logs Real request logs or traces, which often carry identifiers.
  • Personal or customer data Real names, e-mails or records, including in seed data or screenshots.

The current tree is not the whole repository

Deleting a file in a later commit removes it from the tree but not from history; anyone can still check out the older commit. So a hygiene check has two halves: scan the current tracked files, and scan the history. If something real was ever committed, deleting it is not enough. The value must be treated as exposed and rotated, and the history cleaned with the owner’s explicit approval, because rewriting history is a destructive Git operation the course tells you never to do casually.

Key ideaAsk two questions: is it in the tree now, and was it ever in the history?

Read with careThe brief asks you to confirm; it does not prescribe a tool. If you use a scanner, record which one and its limits. If it was not available, say so instead of implying a clean result.

Ignore files are part of the security story

Module 4 called the .dockerignore part of the security story: it keeps .env, .git, virtual environments, caches and build artifacts out of the image. .gitignore does the same job for commits. Both are preventive. Neither removes something already committed, and neither replaces looking. A useful check is to read the build context and the tracked file list once with your own eyes before release.

  • .gitignore excludes .env, virtual environments and caches.
  • .dockerignore excludes .env and .env.*, .git, virtual environments, caches and files the API does not need.
  • No .env, key or credential file is tracked now.
  • No such file appears anywhere in the history.
  • Seed data, screenshots and docs contain only clearly synthetic names and values.

Data you shared with AI is part of governance

Module 5’s governance retrospective asked three questions: what did I share, what did I receive, and what pattern changes. Its risk levels are Low for public, toy or course-only material with no secrets or real private data; Medium for private but non-sensitive code or details; High for credentials, secrets, personal data, real customer data, private production logs or sensitive business logic. The same categories the brief bans from the repository are the ones you should never paste into an AI tool.

Risk levels for what you share with AI · Module 5 lecture notes p. 9
Risk levelMeaningExamples
LowPublic, toy, or course-only material that contains no secrets or real private data.Task Tracker sample code, public README text, toy test data.
MediumPrivate but non-sensitive code or project details.Private repository snippets, internal naming conventions, non-secret stack traces.
HighCredentials, secrets, PII, real customer data, private production logs, or sensitive business logic.API keys, .env values, tokens, real customer names, personal data, proprietary production incidents.

Describe a sensitive category, never its value

Evidence documents sometimes need to mention that something sensitive exists, for example that an environment variable is required. Name the category and where it is configured; never copy the value. The same applies to evidence about scans: “no .env or key file tracked” is good evidence; pasting what you found is not.

Key ideaA rule a teammate can test: the document passes only if a reader cannot learn any secret value from it.

Key takeaways

  • The brief bans secrets, tokens, .env files, credentials, production logs and personal or customer data from the repo.
  • Check both the current tree and the history; deleting a file does not unpublish it.
  • Ignore files prevent new mistakes; they do not fix old ones.
  • The same categories are the ones you never paste into an AI tool.

From the end-of-course project brief and the Module 1-5 lecture notes; the detailed assignment file was not supplied.

Your study checkpoint

Ready to continue?

Mark the lesson complete once you have read it and tried its idea on something real.

Next · Part 4