agentleFS
aaziraniaazirani/flutter_agentify/.agents/skills/secrets/SKILL.md

secrets

Skill0 starsChanged 4 days agoMITView on GitHub

How API keys are handled in a shipped app, the three allowed patterns and the places a key must never appear. Use when adding anything that needs a key, token or password, or when a secret check fails.

  • Reads credentials

14 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ship.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AWSSkill

    ship

    Finalize dev work on an issue branch — update docs, push, and open a PR.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Don't load this for choosing a model server.

    line 8
  2. Distinctive:

    No key in source, assets, tests or anything sent to the model.

    line 12
  3. Very specific:

    If the lint or check fires on a test string that only looks like a key, change the string.

    line 34

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Secrets

Don't load this for choosing a model server; see model-providers.

Rule

No key in source, assets, tests or anything sent to the model. A shipped app uses one of three patterns:

  1. On the device or local network: a model that needs no key (Ollama, LM Studio).
  2. Your own proxy: a server holds the key; the app only knows the proxy's address (backend-proxy).
  3. A key the person types: saved in secure storage, one per preset, never on web.

Enforced by the no_secret_literals lint (app source, run by dart analyze --fatal-infos) and the doctor's bundled-secrets check (assets listed in pubspec.yaml, and the Dart source under packages/).

Why

An app bundle can be unpacked, so a key inside it is public. A key in model input can be repeated back by the model, stored in a thread, or logged.

How

  • The key's only home is SecretStore (lib/domain/repositories/secret_store.dart), implemented by SecureSecretStore in lib/data/repositories/secure_secret_store.dart (Keychain, Keystore and desktop equivalents). It keeps one key per preset (getApiKey(presetId)), so a key typed for one server is never sent to another. Tests use lib/data/repositories/in_memory_secret_store.dart.
  • The key is written by the set_api_key action in lib/domain/actions/settings_actions.dart, which is not an agent tool (agentTool => false): the assistant cannot read or set it.
  • set_assistant_provider refuses an http:// address to a host outside the local network when the preset takes a key (keyUse is not none); http:// is only for local hosts (isLocalHost in lib/domain/entities/assistant_settings.dart). Use https:// for everything else.
  • The settings form (lib/presentation/settings/assistant_settings_section.dart) hides the key field on web and when the preset takes no key (KeyUse.none), uses obscureText, and shows only "key saved", never the value.
  • The lint and the doctor match the shapes in secret_patterns.dart (core and lints each keep a copy): sk-, Google, GitHub, Slack, AWS, Stripe, Groq, Hugging Face and xAI keys, JWTs, Bearer tokens and private-key headers.
  • The registry redacts key-shaped text from action output; do not rely on it, just never return a key.
  • The macOS keychain note in SecureSecretStore (login keychain, because debug builds are unsigned) is deliberate; leave it.
  • Build-time values (--dart-define) are compiled into the app, so they are not a hiding place.
  • If the lint or check fires on a test string that only looks like a key, change the string. Use // ignore: flutter_agentify_lints/no_secret_literals only with a reason; the doctor's ratchet counts ignores and the number may only go down.

Anti-patterns

  • A .env file, or a key, in assets/ (the doctor fails on both).
  • A key in a prompt, a screen summary (lib/ai/screen_contexts.dart), a receipt or a log line.
  • Storing the key in shared preferences instead of SecretStore.
  • Adding a web field for the key "just for testing".

Verification

  • dart analyze --fatal-infos for the lint; dart run flutter_agentify_core:doctor --only bundled-secrets for assets.
  • test/actions/set_api_key_test.dart covers the action.
  • tool/check.sh runs both (see verify).

Related skills

  • backend-proxy — pattern 2 in detail
  • model-providers — which presets need a key
  • approval-and-safety — what the assistant may not do

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.