Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(agents): route security fixes to posthog-private, never public (#111114)

Georges-Antoine Assiedb93b270ec3
diff --git a/.agents/security.md b/.agents/security.md
index 8e8605b6329a..918d6c348c7d 100644
--- a/.agents/security.md
+++ b/.agents/security.md
@@ -1,5 +1,19 @@
# Security guidelines for agents
+## Routing security fixes
+
+**Security fixes are developed in private, never in this public repo.**
+A public PR, branch, issue, or comment about a vulnerability discloses it before the fix is deployed.
+
+- **Where:** open the change against the private mirror **`PostHog/posthog-private`**, not `PostHog/posthog`.
+- **Branch name:** start it with **`security/`**, for example `security/idor-dashboards`.
+- **Never on `PostHog/posthog`:** no PR, branch, or issue that fixes or describes a security weakness, however small or obvious, and no test that demonstrates the exploit.
+- **What counts:** closing an access-control or IDOR gap, an injection (SQL, HogQL, command, path), SSRF, an auth, session, or token weakness, secret exposure, XSS, CSRF, an open redirect, or any change whose purpose is to close an exploitable hole.
+- **If unsure, treat it as a security fix** and route it privately.
+- **Reporting:** keep audit and review findings in the session or private channels; never paste exploit details or vulnerable paths into a public PR, issue, or comment.
+
+This section is about where the fix lands; the rest of this doc is about writing secure code.
+
## Principle of Least Privilege
Default to the smallest permission, narrowest field set, and shortest scope that still works. If a change needs more access than what's already in place, stop and reconsider the design before widening it.
diff --git a/.agents/skills/security-audit/SKILL.md b/.agents/skills/security-audit/SKILL.md
index acd344c29606..87d6a441efb3 100644
--- a/.agents/skills/security-audit/SKILL.md
+++ b/.agents/skills/security-audit/SKILL.md
@@ -222,7 +222,8 @@ Once the report is delivered, ask the user whether they want the findings fixed.
- Run any adjacent existing tests for the affected module to catch regressions.
- Report back which findings were fixed, which tests pass, and anything that needs follow-up.
-Do not start fixing without explicit approval — the user may want to triage, file tickets, or fix in a separate branch.
+Do not start fixing without explicit approval — the user may want to triage, file tickets, or fix in `PostHog/posthog-private` on a `security/<topic>` branch.
+A fix and its reproducer test never go to public `PostHog/posthog`; see [Routing security fixes](../../security.md#routing-security-fixes).
## Output format
diff --git a/AGENTS.md b/AGENTS.md
index b9bcd39d482b..f664df0eae4d 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -142,6 +142,7 @@ Examples:
## Security
+**Security fixes never land in this public repo.** Open them against `PostHog/posthog-private` on a `security/` branch; see [Routing security fixes](.agents/security.md#routing-security-fixes).
Do not add new `INTERNAL_API_SECRET` callers.
Read [.agents/security.md](.agents/security.md) before touching auth, secrets, service-to-service calls, raw SQL, or HogQL string building — it covers least privilege, the injection rules, and how to respond when semgrep flags your code.
`.semgrep/rules/security/` is the enforced set; run `semgrep --config .semgrep/rules/security/ .` to check a change locally.