finitemonkey 0.1.0-next.2 → 0.1.0-next.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "finitemonkey",
3
- "version": "0.1.0-next.2",
3
+ "version": "0.1.0-next.21",
4
4
  "description": "Claude Code hooks that stop a coding agent from saying done before the tests pass: a machine-checked definition of done, plus guardrails for secrets, git safety and production. Pre-release.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -33,6 +33,7 @@
33
33
  },
34
34
  "files": [
35
35
  "dist",
36
+ "runbooks",
36
37
  "LICENSE",
37
38
  "NOTICE",
38
39
  "README.md"
@@ -55,13 +56,24 @@
55
56
  "i18n:check": "node dist/finitemonkey.mjs i18n check --dir src/i18n",
56
57
  "bench:startup": "node scripts/bench-startup.mjs",
57
58
  "smoke:install": "node scripts/smoke-install.mjs",
58
- "check": "npm run typecheck && npm run lint && npm run format:check && npm run check:dist && npm test && npm run i18n:check && npm pack --dry-run && npm run llms:check",
59
+ "check": "npm run typecheck && npm run lint && npm run format:check && npm run check:dist && npm test && npm run i18n:check && npm run plugin:validate && npm pack --dry-run && npm run llms:check && npm run schema:check && npm run docs:check && npm run runbooks:check",
59
60
  "prepublishOnly": "npm run typecheck && npm run check:dist && npm test",
60
61
  "prepare": "husky",
61
62
  "gif": "tsc -p assets/scripts && node --experimental-strip-types assets/scripts/render.ts",
62
63
  "social": "tsc -p assets/scripts && node --experimental-strip-types assets/scripts/social.ts",
63
64
  "llms": "tsx scripts/build-llms.ts",
64
- "llms:check": "tsc -p scripts && tsx scripts/build-llms.ts --check"
65
+ "llms:check": "tsc -p scripts && tsx scripts/build-llms.ts --check",
66
+ "llms:stamp": "tsx scripts/build-llms.ts --stamp",
67
+ "schema": "tsx scripts/build-schemas.ts",
68
+ "schema:check": "tsx scripts/build-schemas.ts --check",
69
+ "budgets": "tsx scripts/budgets.ts",
70
+ "docs": "tsx scripts/build-docs.ts",
71
+ "docs:check": "tsc -p scripts && tsx scripts/build-docs.ts --check",
72
+ "runbooks:check": "tsx scripts/check-runbooks.ts",
73
+ "e2e:claude": "node --import tsx --test --test-concurrency=1 test/e2e/claude-stop.e2e.ts",
74
+ "plugin:sync": "node scripts/plugin-sync.mjs",
75
+ "plugin:validate": "node scripts/plugin-validate.mjs",
76
+ "version": "node scripts/plugin-sync.mjs"
65
77
  },
66
78
  "devDependencies": {
67
79
  "@commitlint/cli": "^21.2.4",
@@ -76,6 +88,7 @@
76
88
  "eslint": "^10.13.0",
77
89
  "eslint-plugin-simple-import-sort": "^14.0.0",
78
90
  "husky": "^9.1.7",
91
+ "playwright-core": "^1.64.1",
79
92
  "prettier": "^3.9.10",
80
93
  "semantic-release": "^25.0.9",
81
94
  "tsx": "^4.23.15",
@@ -0,0 +1,31 @@
1
+ # Anthropic API keys
2
+
3
+ Applies to rule `anthropic-api-key`.
4
+
5
+ ## 1. Revoke
6
+
7
+ In the Claude Console, open **Settings** > **API keys** and disable or delete the key. With an admin key, `POST /v1/organizations/api_keys/{api_key_id}` with `{"status": "inactive"}` does the same.
8
+
9
+ ## 2. Issue the new credential
10
+
11
+ Create the new key in a workspace that holds only this application, with spend limits set on that workspace. Do not reuse one key across environments.
12
+
13
+ ## 3. Replace it in every consumer
14
+
15
+ Update the secret store, CI secrets and every service that reads `ANTHROPIC_API_KEY`.
16
+
17
+ ## 4. Check for misuse in the exposure window
18
+
19
+ Review usage and cost for the workspace in the window. Requests or spend you cannot explain mean the key was used by someone else.
20
+
21
+ ## 5. Delete the old credential after observation
22
+
23
+ After a few days with no errors from consumers, archive or delete the disabled key.
24
+
25
+ ## 6. Notification duties
26
+
27
+ Prompts and files sent with the key may hold personal data. If the key could read stored files or batches, assess notice duties.
28
+
29
+ ## Sources
30
+
31
+ - https://platform.claude.com/docs/en/api/admin-api/apikeys/update-api-key (accessed 2026-10-26)
@@ -0,0 +1,31 @@
1
+ # Asaas API keys
2
+
3
+ Applies to rule `asaas-api-key`.
4
+
5
+ ## 1. Revoke
6
+
7
+ As an account administrator, open **Integrações** in the web interface and delete the exposed key. A deleted key cannot be restored. A parent account can also revoke a subaccount key through the API.
8
+
9
+ ## 2. Issue the new credential
10
+
11
+ Create the new key in the same area. Use a separate key per subaccount and per environment, and never put a production key in a sandbox configuration.
12
+
13
+ ## 3. Replace it in every consumer
14
+
15
+ Update the backend secret store, CI secrets and every worker that calls the API.
16
+
17
+ ## 4. Check for misuse in the exposure window
18
+
19
+ Review charges, transfers, PIX keys, bank account changes and webhook settings for the window, in the account and in every subaccount the key could reach.
20
+
21
+ ## 5. Delete the old credential after observation
22
+
23
+ If you created a temporary key during the switch, delete it after a few days without errors.
24
+
25
+ ## 6. Notification duties
26
+
27
+ Asaas keys reach customer names, tax ids and payment data. If they were read, assess notice duties under the LGPD toward the ANPD and the people affected.
28
+
29
+ ## Sources
30
+
31
+ - https://docs.asaas.com/docs/chaves-de-api (accessed 2026-10-26)
@@ -0,0 +1,32 @@
1
+ # AWS access keys
2
+
3
+ Applies to rules `aws-access-token` and `aws-secret-access-key`.
4
+
5
+ ## 1. Revoke
6
+
7
+ In the IAM console, open the user, then **Security credentials** > **Access keys**, and set the exposed key to **Inactive** (`aws iam update-access-key --access-key-id <id> --status Inactive --user-name <user>`). Inactive keys stop signing requests at once and can still be turned back on if something critical breaks.
8
+
9
+ ## 2. Issue the new credential
10
+
11
+ Prefer no long-lived key at all: an IAM role for EC2, ECS or Lambda, or OIDC federation for CI (GitHub Actions `aws-actions/configure-aws-credentials` with a role). If a key is unavoidable, create it on a user whose policy grants only what the consumer needs (`aws iam create-access-key --user-name <user>`).
12
+
13
+ ## 3. Replace it in every consumer
14
+
15
+ Update the secret store, CI secrets, `.env` files outside git, and every host that had the old key. Restart the processes that read it at start.
16
+
17
+ ## 4. Check for misuse in the exposure window
18
+
19
+ Run `aws iam get-access-key-last-used --access-key-id <id>` and search CloudTrail for the key id from the first exposure until it went inactive. Look for new IAM users, new keys, new regions, EC2 instances you did not start and S3 reads you do not recognize.
20
+
21
+ ## 5. Delete the old credential after observation
22
+
23
+ After a few days with no errors from consumers and no use of the old id, delete it (`aws iam delete-access-key --access-key-id <id> --user-name <user>`).
24
+
25
+ ## 6. Notification duties
26
+
27
+ If CloudTrail shows access to personal data, the data protection law that applies (LGPD, GDPR or a state law) may require notice to the regulator and to the people affected. Record what was reachable with the key and decide with whoever owns that duty.
28
+
29
+ ## Sources
30
+
31
+ - https://docs.aws.amazon.com/IAM/latest/UserGuide/id-credentials-access-keys-update.html (accessed 2026-10-26)
32
+ - https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html (accessed 2026-10-26)
@@ -0,0 +1,31 @@
1
+ # Cloudflare API tokens
2
+
3
+ Applies to Cloudflare API tokens and global API keys found by the generic rules.
4
+
5
+ ## 1. Revoke
6
+
7
+ Go to **My Profile** > **API Tokens**, open the menu next to the token and choose **Roll**. Rolling invalidates the old secret at once and keeps the same permissions. A global API key can be changed on the same page.
8
+
9
+ ## 2. Issue the new credential
10
+
11
+ Prefer a scoped API token over the global API key: only the zones and permissions the consumer needs, with client IP filtering and a TTL when the consumer runs from known addresses.
12
+
13
+ ## 3. Replace it in every consumer
14
+
15
+ Update CI secrets, Workers secrets, Terraform variables and any tool that calls the API.
16
+
17
+ ## 4. Check for misuse in the exposure window
18
+
19
+ Read the account audit log for the window: DNS changes, new Workers or routes, page rules, firewall changes, new members and new tokens.
20
+
21
+ ## 5. Delete the old credential after observation
22
+
23
+ Delete any extra token created during the change once consumers have run without errors for a few days.
24
+
25
+ ## 6. Notification duties
26
+
27
+ DNS or Workers changes can redirect user traffic. If that happened, treat it as a breach of the affected service and assess notice duties.
28
+
29
+ ## Sources
30
+
31
+ - https://developers.cloudflare.com/fundamentals/api/how-to/roll-token/ (accessed 2026-10-26)
@@ -0,0 +1,32 @@
1
+ # Database and Redis passwords
2
+
3
+ Applies to rules `credential-in-url`, `password-assignment` and `secret-in-process-args` when the value is a database or Redis password.
4
+
5
+ ## 1. Revoke
6
+
7
+ PostgreSQL: `ALTER ROLE <role> WITH PASSWORD NULL;` or `ALTER ROLE <role> NOLOGIN;` until the new password is in place. MySQL: `ALTER USER '<user>'@'<host>' ACCOUNT LOCK;`. Redis with ACLs: remove the password from the user (`ACL SETUSER <user> <<old-password>`), or with `requirepass` change it in the config and restart.
8
+
9
+ ## 2. Issue the new credential
10
+
11
+ Generate a long random password (`ACL GENPASS` in Redis, `openssl rand -base64 32` elsewhere), or move to IAM database authentication or short-lived credentials from a secrets manager. Give each application its own role with only the grants it needs.
12
+
13
+ ## 3. Replace it in every consumer
14
+
15
+ Update connection strings in the secret store, compose files (from a variable, never a literal argument), CI, migrations and backup jobs. Restart connection pools.
16
+
17
+ ## 4. Check for misuse in the exposure window
18
+
19
+ Check the server log for logins from unknown addresses, `pg_stat_activity` or `SHOW PROCESSLIST` for unknown sessions, and look for new roles, changed grants, dropped tables or large reads. Check whether the port was reachable from the internet during the window.
20
+
21
+ ## 5. Delete the old credential after observation
22
+
23
+ Remove temporary roles or extra Redis passwords added for the switch after the applications have run cleanly for a few days.
24
+
25
+ ## 6. Notification duties
26
+
27
+ A database usually holds personal data. If anyone outside your team could have connected, treat it as a possible breach and assess notice duties toward the regulator and the people affected.
28
+
29
+ ## Sources
30
+
31
+ - https://www.postgresql.org/docs/17/sql-alterrole.html (accessed 2026-10-26)
32
+ - https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/ (accessed 2026-10-26)
@@ -0,0 +1,31 @@
1
+ # DigitalOcean API tokens
2
+
3
+ Applies to DigitalOcean personal access tokens (`dop_v1_`) found by the generic rules.
4
+
5
+ ## 1. Revoke
6
+
7
+ In the control panel, open **API** > **Tokens**, find the token and choose **Delete**, or **Regenerate** if consumers must keep the same name and scopes.
8
+
9
+ ## 2. Issue the new credential
10
+
11
+ Create a token with custom scopes limited to the resources the consumer touches and an expiration date. Scopes cannot be edited later, so pick them now.
12
+
13
+ ## 3. Replace it in every consumer
14
+
15
+ Update CI secrets, `doctl auth` contexts, Terraform variables and every host that used the old token.
16
+
17
+ ## 4. Check for misuse in the exposure window
18
+
19
+ Review the account's security history and the resource list for the window: new Droplets, volumes, snapshots, firewall changes, new SSH keys and Spaces access keys you did not create.
20
+
21
+ ## 5. Delete the old credential after observation
22
+
23
+ If you regenerated instead of deleting, confirm nothing still fails with the old value, then delete any leftover token created for the transition.
24
+
25
+ ## 6. Notification duties
26
+
27
+ If Droplets or databases with personal data were reachable, assess notice duties under the law that applies to that data.
28
+
29
+ ## Sources
30
+
31
+ - https://docs.digitalocean.com/reference/api/create-personal-access-token/ (accessed 2026-10-26)
@@ -0,0 +1,31 @@
1
+ # Any other credential
2
+
3
+ Applies to rules without a provider runbook: `generic-api-key`, `jwt`, `private-key`, `gitlab-pat`, `npm-access-token` and the Slack rules.
4
+
5
+ ## 1. Revoke
6
+
7
+ Find the provider that issued the value and revoke or disable it there. For a private key, remove its public half from every place that trusts it (`authorized_keys`, deploy keys, certificates). For a JWT signing secret, rotate the secret, which invalidates every token it signed.
8
+
9
+ ## 2. Issue the new credential
10
+
11
+ Prefer short-lived credentials (OIDC, roles, tokens with an expiry) over long-lived ones, and give the new value only the scope the consumer needs.
12
+
13
+ ## 3. Replace it in every consumer
14
+
15
+ Update the secret store, CI secrets, `.env` files outside git and every host that had the old value.
16
+
17
+ ## 4. Check for misuse in the exposure window
18
+
19
+ Read the provider's audit or access log from the first exposure until revocation and look for actions you did not take.
20
+
21
+ ## 5. Delete the old credential after observation
22
+
23
+ Delete leftover records of the old value once consumers have run without errors for a few days.
24
+
25
+ ## 6. Notification duties
26
+
27
+ If the credential reached personal data, assess notice duties under the law that applies.
28
+
29
+ ## Sources
30
+
31
+ - https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html (accessed 2026-10-26)
@@ -0,0 +1,32 @@
1
+ # GitHub tokens
2
+
3
+ Applies to rules `github-pat`, `github-oauth`, `github-app-token`, `github-refresh-token` and `github-fine-grained-pat`.
4
+
5
+ ## 1. Revoke
6
+
7
+ For a personal access token, go to **Settings** > **Developer settings** > **Personal access tokens** and delete it. For an OAuth or GitHub App token, revoke the authorization under **Settings** > **Applications**, or rotate the app's client secret. A revoked token cannot be restored.
8
+
9
+ ## 2. Issue the new credential
10
+
11
+ Use the narrowest path that works: `GITHUB_TOKEN` inside Actions, a GitHub App installation token for automation, or a fine-grained personal access token limited to the repositories and permissions the consumer needs, with an expiration date.
12
+
13
+ ## 3. Replace it in every consumer
14
+
15
+ Update repository and organization secrets, CI variables, local `gh auth` sessions, git remotes that carried the token in the URL (`git remote set-url`) and credential helpers.
16
+
17
+ ## 4. Check for misuse in the exposure window
18
+
19
+ Check the security log (**Settings** > **Security log**, or the organization audit log) for the window: new deploy keys, new tokens, changed branch protection, pushes and releases you did not make, and repositories made public or transferred.
20
+
21
+ ## 5. Delete the old credential after observation
22
+
23
+ A deleted token is already gone. If you only reduced an app's access, remove the old installation or secret after a few days without failures.
24
+
25
+ ## 6. Notification duties
26
+
27
+ If private repositories with personal data or customer code were readable, tell the owners of that data and check contractual and legal duties to notify.
28
+
29
+ ## Sources
30
+
31
+ - https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/token-expiration-and-revocation (accessed 2026-10-26)
32
+ - https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens (accessed 2026-10-26)
@@ -0,0 +1,31 @@
1
+ # Google OAuth client secrets and API keys
2
+
3
+ Applies to rule `gcp-api-key` and to OAuth client secrets found by the generic rules.
4
+
5
+ ## 1. Revoke
6
+
7
+ For an API key, open **APIs & Services** > **Credentials** and regenerate or delete the key. For an OAuth client secret, add a new secret to the client, then disable the exposed one.
8
+
9
+ ## 2. Issue the new credential
10
+
11
+ Restrict a new API key to the APIs it calls and to the referrers, IPs or apps that use it. For OAuth, keep the client and rotate only the secret. For server-to-server access prefer workload identity federation over service account key files.
12
+
13
+ ## 3. Replace it in every consumer
14
+
15
+ Update the backend configuration, CI secrets and any mobile or web build that embeds the key.
16
+
17
+ ## 4. Check for misuse in the exposure window
18
+
19
+ Check API usage metrics and billing for the key's project in the window, and Cloud Audit Logs for calls you do not recognize.
20
+
21
+ ## 5. Delete the old credential after observation
22
+
23
+ Delete the disabled OAuth secret once the new one has served traffic without errors.
24
+
25
+ ## 6. Notification duties
26
+
27
+ If the client could read user data through granted scopes, assess notice duties toward those users and the regulator.
28
+
29
+ ## Sources
30
+
31
+ - https://support.google.com/cloud/answer/6158849 (accessed 2026-10-26)
@@ -0,0 +1,31 @@
1
+ # Mailgun API keys
2
+
3
+ Applies to Mailgun keys found by the generic rules (for example a `MAILGUN_KEY` assignment).
4
+
5
+ ## 1. Revoke
6
+
7
+ In the Mailgun control panel, open **API Security** and delete the exposed account key or domain sending key.
8
+
9
+ ## 2. Issue the new credential
10
+
11
+ Prefer a domain sending key, which can only send mail for one domain, over an account key. Create an account key only for tools that manage the account, with the narrowest role.
12
+
13
+ ## 3. Replace it in every consumer
14
+
15
+ Update the application configuration, CI secrets and any SMTP credentials that shared the leak.
16
+
17
+ ## 4. Check for misuse in the exposure window
18
+
19
+ Review sending logs and events for the window: mail you did not send, new domains, new routes or webhooks, and spikes in bounces or complaints that point to spam sent in your name.
20
+
21
+ ## 5. Delete the old credential after observation
22
+
23
+ Remove any temporary key created for the switch after a few days without delivery errors.
24
+
25
+ ## 6. Notification duties
26
+
27
+ If message logs or mailing lists with personal data were readable, assess notice duties. If spam went out under your domain, warn the recipients' contact point and watch your domain reputation.
28
+
29
+ ## Sources
30
+
31
+ - https://documentation.mailgun.com/docs/mailgun/user-manual/api-key-mgmt/rbac-mgmt (accessed 2026-10-26)
@@ -0,0 +1,31 @@
1
+ # OpenAI API keys
2
+
3
+ Applies to rule `openai-api-key`.
4
+
5
+ ## 1. Revoke
6
+
7
+ On the API keys page of the OpenAI platform, revoke the exposed key. Revocation takes effect at once.
8
+
9
+ ## 2. Issue the new credential
10
+
11
+ Create a project key or a service account key in a project that holds only this application, with spend limits and, where the organization allows it, a maximum key lifetime.
12
+
13
+ ## 3. Replace it in every consumer
14
+
15
+ Update the secret store, CI secrets and every service that reads `OPENAI_API_KEY`.
16
+
17
+ ## 4. Check for misuse in the exposure window
18
+
19
+ Review usage per project and per key in the window. Calls or spend you cannot explain mean the key was used by someone else.
20
+
21
+ ## 5. Delete the old credential after observation
22
+
23
+ Remove any temporary key created for the switch once the new key has run cleanly for a few days.
24
+
25
+ ## 6. Notification duties
26
+
27
+ If the key could reach stored files, assistants or fine-tuning data with personal data, assess notice duties.
28
+
29
+ ## Sources
30
+
31
+ - https://developers.openai.com/api/docs/guides/production-best-practices (accessed 2026-10-26)
@@ -0,0 +1,31 @@
1
+ # Stripe secret and restricted keys
2
+
3
+ Applies to rule `stripe-access-token`.
4
+
5
+ ## 1. Revoke
6
+
7
+ On **Developers** > **API keys**, open the menu next to the key and choose **Roll key** with expiration **Now**, or **Expire key**. A rolled key with a later expiration keeps working until then, so choose **Now** for a leaked key.
8
+
9
+ ## 2. Issue the new credential
10
+
11
+ Create a restricted key (`rk_live_`) with only the permissions the integration needs and attach an access policy (IP addresses or allowed networks) so the key works only from your servers.
12
+
13
+ ## 3. Replace it in every consumer
14
+
15
+ Update the secret store or environment of every backend, worker and CI job. Webhook signing secrets are separate; roll them too if they were in the same file.
16
+
17
+ ## 4. Check for misuse in the exposure window
18
+
19
+ Open the request logs for the old key in Workbench and review the window: refunds, payouts, transfers, changes to payout bank accounts, new webhook endpoints and customer data exports.
20
+
21
+ ## 5. Delete the old credential after observation
22
+
23
+ If you rolled with a delay, confirm the old key's request volume stayed at zero, then let it expire or expire it now.
24
+
25
+ ## 6. Notification duties
26
+
27
+ Card data never passes through your keys, but customer names, emails and addresses do. If they were read, assess notice duties under the law that applies and tell Stripe support about suspicious activity.
28
+
29
+ ## Sources
30
+
31
+ - https://docs.stripe.com/keys (accessed 2026-10-26)