Repository navigation
chore(aio): document and test project secret keys for evaluations - #1307
Conversation
PR overviewNo security issues were found in this pull request. Reviews
|
There was a problem hiding this comment.
Approved.
Documentation and mocked transport tests only; credential handling, authorization behavior, and public interfaces are unchanged. No open review concerns or other blocking grounds were reported.
- Author wrote 100% of the modified lines and has 13 merged PRs in these paths (familiarity STRONG).
- PostHog Review (Standard) reviewed the current head: no findings.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| every_file_attested | ✓ | not a bot PR |
| size | ✓ | 27L, 5F substantive, 119L/7F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (119L, 7F, two-areas, chore) |
| stamphog 2.9.1 | .stamphog/policy.yml @ bfce8e3 · reviewed head bfce8e3 |
SDK performance: posthog-pythonBenchmarks completed. No changes flagged for review. Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate. View all results
Values are medians of paired measurements. Not flagged does not mean unchanged. Unavailable means a measurement could not be provided, not zero. Estimated allocation measurements retain their instrumentation uncertainty. RSS measures the whole process, not just SDK allocations; observed peaks are sampled checkpoints. Paired ranges in the diagnostics describe variability, not confidence intervals. Each shard uses its own runner; compare Before PR against With PR within a row, not across shards. Compared 102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in |
💡 Motivation and Context
The offline evaluations example previously required a personal key for scorer and dataset management. Its setup and API docstrings now explain which scopes a project secret key needs for provisioning, uploads, stored composite inputs, and corrections. Dataset exports still require a personal API key.
💚 How did you test it?
All 712 tests passed in
posthog/test/ai/test_evaluations*.py. The new sync test checks the outbound bearer header on dataset, scorer, and experiment management requests. The async transport test now covers both key types. Ruff passed.📝 Checklist
If releasing new changes
Documentation and tests only. No SDK release is required to use a project key.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Codex (GPT-6) updated the evaluations guidance and tests against the shared SDK contract. The SDK already forwards the configured bearer token. The service decides which operations the key can perform.