Practical AI advice for teams and leaders

Beginner Steps. Advanced AI.

Published guideUpdated

Chapter 5 of 20Set up

Chapter menu20 chapters

Keep private information safe

Protect passwords and keys, and check what will enter your project history.

Kooka, a friendly kookaburra teacher wearing glasses and holding a blue notebook.

A few simple habits keep private information out of your website.

Follow the pictures

Illustrated examples. Your app may look different. Tap an image to enlarge it.

  1. Keep secrets outside the project

    Keep keys and recovery codes in a password manager or secure storage, outside chat and fieldnotes-studio.

    Illustration: keep credentials in private storage rather than a website folder or chat.
    Illustrated example
    Store
    Passwords, keys and recovery codes → Protected storage

    Look for: Private credentials stay outside chat and the website project.

    More help with this action

    Git remembers old commits: deleting a key from today's file leaves its history. Revoke exposed credentials at their provider before addressing repository history. Private repositories are not secret managers. Environment variables supply settings to tools. A .env file can hold local settings, but is unnecessary for desktop sign-in. Visitors can read browser code; Astro PUBLIC_ variables must contain public information only.

    Show the steps
    1. Use a password manager for recovery codes and keys, following credential protection guidance. Use application sign-in flows rather than creating credentials documents in fieldnotes-studio.
    2. Use the app's sign-in flow instead of creating a passwords document in your project.
    3. A private GitHub repository is not a secret manager. Keep secrets out of screenshots, logs, prompts and source files.
    4. This static website needs no OpenAI key.

    You should now see: Private credentials stay outside chat and the website project.

  2. Ignore local private files

    Send the secret-boundary prompt. Ask Codex to merge the .gitignore starter rules without deleting existing entries.

    Illustration: merge .gitignore rules to exclude local settings and generated files from new commits.
    Illustrated example
    In Codex
    Copy secret-boundary prompt → Send
    Review
    .gitignore → Existing entries preserved

    Look for: The merged .gitignore excludes local secret files and generated folders.

    More help with this action

    Follow these steps if you want more help.

    Show the steps
    1. Ask Codex to merge the starter .gitignore rules with existing entries. Consult GitHub ignored-files guidance and preserve current exclusions.
    2. Open the merged .gitignore and compare it with the starter rules.
    3. The rules exclude node_modules, dist, .astro, .env and .env.* while allowing a harmless .env.example.
    4. An ignore rule affects untracked files; it does not remove files already committed or erase their history.

    You should now see: The merged .gitignore excludes local secret files and generated folders.

  3. Use harmless examples

    This static site needs no .env file. If you document future settings, put only harmless examples in .env.example.

    Illustration: this static site needs no .env; optional examples contain harmless settings only.
    Illustrated example
    For this site
    No .env needed
    If useful later
    .env.example → Harmless settings only

    Look for: The project contains no unnecessary credential file or real secrets in examples.

    More help with this action

    Follow these steps if you want more help.

    Show the steps
    1. This static site needs no .env file. If documenting future settings, use .env.example with harmless values; review Astro environment variables so no real secret is included.
    2. Do not create a .env file just because a tutorial mentions one.
    3. An optional .env.example is documentation. Use clearly harmless placeholder settings rather than copying real secrets.
    4. Astro PUBLIC_ settings can reach the visitor's browser and must contain public information only.

    You should now see: The project contains no unnecessary credential file or real secrets in examples.

  4. Keep future keys on the server

    For a future backend, check where settings run. Ask Codex which values visitors can read before adding any secret.

    Illustration: private keys stay on the server, while browser code and PUBLIC_ settings are public.
    Illustrated example
    Optional future feature
    Ask where each setting runs → Server or browser?

    Look for: You understand why browser code and PUBLIC_ values cannot hide a key.

    More help with this action

    Follow these steps if you want more help.

    Show the steps
    1. For a future backend service, use local environment settings and hosting secret controls. Ask Codex where each value runs and whether visitors can read it.
    2. This plans a future feature; it does not add a backend now. A working email link needs no secret.
    3. For any later service, ask which code runs on a server and which code goes to the browser.
    4. Use protected hosting secret settings for server credentials. A disguised string or hidden form field in browser code is still readable.

    You should now see: You understand why browser code and PUBLIC_ values cannot hide a key.

  5. Review before committing

    Run the ignore and change checks. Ask Codex to flag suspected secrets by filename and type, without printing their values.

    Illustration: check ignored files and review changes without printing suspected secret values.
    Illustrated example
    Run
    git check-ignore .env → git status → git diff
    In Codex
    Report filenames and secret types only

    Look for: The ignore check returns .env and pending changes contain no credentials or recovery codes.

    More help with this action

    Follow these steps if you want more help.

    Show the steps
    1. Before committing, review git status and git diff. Ask Codex to identify suspected secrets without printing their values.
    2. Run git check-ignore .env inside fieldnotes-studio; it should return .env even without creating that file.
    3. Inspect git status and git diff. Stage and review newly added files too; ordinary git diff does not display untracked file contents.
    4. Ask for suspected secret locations and types only. Resolve them before committing; this review is evidence, not a guarantee of security.

    You should now see: The ignore check returns .env and pending changes contain no credentials or recovery codes.

  6. Know what to do after a leak

    If a key leaks, revoke it with its provider. Deleting the file does not remove the key from history.

    Illustration: revoke a leaked credential before addressing files and saved history.
    Illustrated example
    If a key leaks
    Provider settings → Revoke key → Review exposure and history

    Look for: You know to revoke an exposed credential before cleaning up files and history.

    More help with this action

    Follow these steps if you want more help.

    Show the steps
    1. If a credential reaches chat, Git, screenshots, or a public page, revoke it immediately. Follow sensitive-data recovery guidance; deleting the exposure is insufficient.
    2. This is recovery guidance, not a request to revoke a working key. Skip it if nothing has leaked.
    3. Revoke exposed credentials at their provider first. Replace them only if the service still needs them.
    4. Then address repository history and other copies. .gitignore cannot erase old commits or untrack an existing file automatically.

    You should now see: You know to revoke an exposed credential before cleaning up files and history.

Why this step matters

Visitors can inspect browser code. Passwords and keys belong in protected storage, never in the code sent to their browser.

Git keeps old versions. If a key leaks, revoke it first; deleting today’s file does not make that key safe.

Basics, explained

Secret

A value that grants access, such as a password, API key, private token, or recovery code.

Environment variable

A named setting supplied to a running program by its environment. It can hold public configuration or private credentials.

.gitignore

A file listing local paths Git should leave untracked. It does not remove files already committed.

Backend

Code running on a server or service, where private credentials and protected operations can stay away from the visitor's browser.

Ask your agent

PromptSet up the secret boundary

Copy into Codex, then adapt it to your project.

Review credential exposure without printing secrets. Merge sensible Astro and local-secret .gitignore rules, preserving existing entries. This static site needs no API keys. Report suspected credentials by filename and type only. Explain ignoring new files versus removing tracked files.

Files & commands

textStarter exclusions to merge into .gitignore

Read this step before using the example.

node_modules/
dist/
.astro/
.env
.env.*
!.env.example
shellCheck that a local environment file would be ignored

Read this step before using the example.

git check-ignore .env
git status
git diff
Check your work

Tick each item after you confirm it yourself. You can untick it at any time.

If something goes wrong
An ignored secret remains tracked.
Ask Codex to inspect tracking and preserve the local file while removing tracking. Revoke exposed credentials first; history remains.
Codex requests a key for ordinary pages.
Explain that Codex is already authenticated. Ask which actual website service requires the key before adding one.
Personal notes

Add questions, decisions or ideas for your website. Saved in this browser when available; export your notes to keep a copy. Never enter secrets.

Downloads & saved progressGuide, notes and personal checks

Download the complete guide or export your notes from every chapter. Instructions last reviewed: .

Download guide .md Go to starter files

Checks and notes stay in this browser, separately for each language. Export your notes to preserve them. Never enter API keys or other secrets here.

Starter filesWorking instructions and four skills

These templates give your agent a starting set of working instructions. Review them, adapt them to your website, and save each file at the exact path shown, relative to your project folder.

A downloaded skill is an instruction file. It does not install a test runner, run a security scan, or prove your site is safe. The guide shows how to set up and check that work.

Download the instruction files in the language of this guide. Keep the technical filenames and paths as shown.

Download all starter files .md bundle
FileAGENTS.md

Save at the path above.

Download file
# Website working agreements

This project follows the website brief and acceptance criteria we have agreed with its owner. Use the existing technology choices unless a concrete requirement calls for a change.

## How to work

- For a substantial feature, explain the proposed changes and verification plan before implementing it. Complete authorized local work in small, reviewable stages.
- Read the files relevant to the task. Keep unrelated pages and configuration intact.
- Explain new technical terms in plain language when reporting to the owner.
- Use the repository's website-design, clean-code, website-testing and website-security skills when their workflows apply.
- Record important decisions and unresolved content in the project's notes. Do not invent business facts, endorsements or publishing rights.

## Verification

- Inspect package.json to find the actual build, type-check and test commands. Do not invent a successful check or create a meaningless test just to make a command pass.
- Run checks appropriate to the change. Local tests use disposable fixtures and have no production access; run them and repair failures caused by the requested change without asking at every step.
- Verify visitor interactions in a browser when browser tools are available. Report checks that remain unavailable or incomplete.
- Show the owner a working local preview and summarise changed behaviour, evidence and remaining limitations.

## Credentials and publication

- Keep API keys and other secrets out of browser code, prompts, logs and Git. Store local secrets in ignored files or the chosen secret store.
- Local build and test work is authorized. Publishing the site, sending a real message, processing a payment or changing production data requires the owner's authorization for that action.
- Preserve a recoverable working version before release. Describe how to restore it.

These are starter agreements for a new tutorial project. Adapt them to the owner's actual requirements and existing authorization.
File.agents/skills/website-design/SKILL.md

Save at the path above.

Download file
---
name: website-design
description: Develop or refine a website's visual direction and responsive interface from its brief, content and existing design. Use for page design or visual implementation.
---

Read the website brief and any existing design notes relevant to the requested page. Work within the user's brand, content and technology choices.

When establishing a new direction, propose typography, a small colour palette, a spacing rhythm and a sample page. Explain how these choices support the audience and main visitor action. Use real content to judge hierarchy and line lengths.

Implement reusable elements for navigation, headings, buttons and repeated content. Give primary actions a clear visual hierarchy. Preserve visible keyboard focus, readable contrast and usable labels. Design narrow screens alongside desktop screens; check long headings, navigation and tap targets in a browser.

Use semantic HTML before adding custom interaction. Keep motion optional and respect reduced-motion preferences. Use assets with known permission to publish; record their sources. Do not invent client testimonials, achievements or business facts.

Before expanding a design across all pages, show the first complete page at desktop and mobile widths. Describe the main design decisions and any unresolved content. When a browser tool is unavailable, report that visual verification is still pending.
File.agents/skills/clean-code/SKILL.md

Save at the path above.

Download file
---
name: clean-code
description: Implement or refactor website code into understandable components using the project's existing stack and conventions. Use for website implementation or maintainability work.
---

Read the relevant files and package scripts before choosing an implementation. Preserve working behaviour outside the requested change. Prefer the existing stack and dependencies when they meet the need.

Keep page content separate from repeated layout where that makes editing easier. Name components, variables and functions for their purpose. Use shared components for repeated navigation and page elements; avoid abstraction for a single trivial use.

Handle empty, invalid, loading and error states for interactions that need them. Use native browser controls and semantic HTML when they serve the interaction. Avoid fake form submission, simulated success messages and dead links.

Use type checking and the project's formatting or lint rules where configured. When adding a package, explain its purpose and any new maintenance or runtime requirements. Keep generated build output, dependencies and local environment files out of version control.

Run the existing checks relevant to the change, including a production build when output can change. Summarise changed behaviour, verification results and remaining limits. Explain the main files in plain language so a beginner can find and edit their content.
File.agents/skills/website-testing/SKILL.md

Save at the path above.

Download file
---
name: website-testing
description: Verify website changes through visitor journeys, appropriate automated tests and browser checks. Use when testing a website, investigating a failure or preparing a release.
---

Start from the brief and observable acceptance criteria. Inspect existing test and build commands; do not assume that a script exists. Choose checks based on the changed behaviour and the cost of failure.

Exercise the main visitor journey and affected links, navigation and forms. Include invalid input and relevant error states. For a contact form, verify actual delivery in the agreed test destination before reporting that it works. For an email link, explain that it opens the visitor's configured email app and does not send a message automatically.

Check narrow and wide screens in a browser. Include keyboard navigation, visible focus, accessible names, zoom and horizontal overflow. Automated accessibility results complement these manual checks and do not establish complete accessibility conformance.

Add automated tests for important behaviour or demonstrated regressions. Test observable outcomes and meaningful failure cases; avoid tests that merely repeat the implementation or match incidental wording. Use disposable test data and local fixtures. Never send real messages, charge payments or alter production data without the user's authorization.

Reproduce a failure, fix its cause and rerun affected checks. Report commands run, results, browser checks performed and anything not checked. A successful build shows that the site can be generated; verify visitor behaviour separately. Never report a check as passed when it was skipped or unavailable.
File.agents/skills/website-security/SKILL.md

Save at the path above.

Download file
---
name: website-security
description: Review a website's secrets, dependencies, inputs, permissions and deployment configuration, and repair scoped security findings. Use for requested security review or release preparation.
---

Identify the site's relevant surfaces: static pages, forms, backend routes, authentication, third-party scripts and stored data. Scope review to the actual architecture and authorized environment.

Keep credentials out of browser code, logs, prompts and Git. Distinguish build-time public configuration from server secrets. If a key was committed or exposed, stop using it, explain that deleting the file does not revoke the key, and have the owner revoke or rotate it before further use. Do not print the credential in your report.

Inspect applicable dependency advisories and assess whether the affected package and vulnerable behaviour are used. Repair within the project's compatible versions and rerun affected checks. Avoid automatic forced upgrades that may break the website.

For backend interactions, validate inputs on the server, encode output appropriately, and check authentication and authorization separately. Consider abuse controls for public forms or AI endpoints. An OpenAI API key belongs on the server; publishing a static site does not provide a secret server environment.

Check HTTPS and applicable security headers at the actual hosting layer. Collect only the data the feature needs, and explain its destination and retention. Do not claim legal compliance from a code scan.

Report each finding with its location, plausible impact, fix and verification. State review scope, tools used, unresolved findings and inaccessible surfaces. A clean scan is evidence about that scan's scope, not a guarantee that the website has no vulnerabilities. Do not scan third-party systems or deploy changes outside the authorized task.
Back to the chapter start