PostHog · Background agent
StampHog
A GitHub-label-triggered PR approval agent that applies fail-closed deterministic safety gates, asks an LLM to check for showstoppers, autonomously approves eligible changes, and refuses or escalates the rest.
- Approach type
- Background agent
- Work
- Code review
- Human involvement
- Autonomous
- Invocation
- Background, Event driven
- Interfaces
- Github, Ci
- Deployment stage
- Scaled
- Evidence strength
- Detailed primary
- Entry reviewed
How it works
The workflow the sources report for this implementation.
Draft state, conflicts, requested changes, sensitive paths, size ceilings, and risk tiers can block AI approval; the LLM may tighten but never loosen a gate
Eligible changes can be approved while risky, ambiguous, or insufficiently assured changes are refused or escalated to a suitable human reviewer
Each run records PR metadata, classification, gate results, reviewer output, and the final verdict
Where people stay involved
- eligible pull request → approval decisionException only · Level 5
Level 5 for eligible pull request → approval decision; human attention boundary: exception-only.
- Observation date
- 2026-07-09
Implementation details
A GitHub Action invokes a Python pipeline that fetches and classifies a PR, applies hard gates, waits for in-flight reviewer bots, runs an LLM review, and posts a verdict
Claude through the Claude Agent SDK, with Read, Grep, and Glob tools
github, ci
Reads the diff and repository files plus trusted review-state, discussion, ownership, and reviewer signals
Repository-specific deny categories, size and risk tiers calibrated from prior human approvals, review guidance, and ownership data
A dedicated Anthropic organization secret and a StampHog GitHub App token whose approvals satisfy branch protection
Each run emits a versioned JSON evidence bundle retained as a CI artifact for 30 days; a sticky GitHub comment carries non-approval verdict history and labels preserve retry state
Reported results and limitations
The catalog records what the sources report, with the scope and the denominator of every figure. A qualification below limits the figure it sits under.
Reported metrics
Handled 1,600 PRs in the previous month, as reported on July 9, 2026; roughly one in three merged main-repository PRs received its final approval during the reported quarter
- Reported by
- PostHog
- Scope
- Monthly PRs handled autonomously and quarterly final approvals in the main repository
- Denominator
- Merged main-repository PRs for the quarterly share; absolute handled PRs for the monthly count
- Method
- Company-reported production usage
- Observation date
- 2026-07
1,600 PRs handled autonomously in the previous month, as reported on July 9, 2026
The source does not report the denominator of this figure.
- Reported by
- PostHog
- Scope
- PRs handled autonomously in the previous month, as reported on July 9, 2026; exact boundaries unspecified
- Method
- Company-reported production usage
- Observation date
- 2026-07-09
Roughly one in three PRs merged into PostHog's main repository received StampHog's final approval during the reported quarter
- Reported by
- PostHog
- Scope
- Main-repository merged PRs receiving StampHog final approval during the reported quarter
- Denominator
- Merged PRs in the main repository
- Method
- Company-reported production usage
- Observation date
- 2026-07
20% of PRs approved by StampHog in the July 28, 2026 report, at approximately $300 per month in tokens
- Reported by
- PostHog
- Scope
- PostHog PRs approved by StampHog and monthly token cost in the July 28, 2026 report
- Denominator
- PostHog PRs in the report's scope
- Method
- Company-reported production usage and token spend
- Observation date
- 2026-07
Lessons and interpretation
Use deterministic controls for known risks and allow the LLM to make approval stricter, never more permissive
Calibrate thresholds and deny categories from repository history rather than treating small diffs as inherently safe
Fail closed and preserve retry state when dependencies, credentials, or concurrent reviewer bots are unavailable
Sources and research details
Citations link to the original publisher. Each source also keeps a preserved copy in the repository, so a changed or removed page stays checkable.
- Stop being the code review bottleneckhttps://posthog.com/newsletter/code-review-tips
- 10,000 PRs a month is easy: How devex is evolving at PostHoghttps://posthog.com/blog/10k-prs-a-month
- StampHog PR approval agent source code and documentationhttps://github.com/PostHog/posthog/tree/988c9031bb93c74bafcdfb670c01497c79a4f644/tools/pr-approval-agent
Research details for every claim on this page
- Summary
- Statement type
- Fact
- Provenance
- Reported
- Confidence
- High
- Confidence reason
- A linked first-party source states the claim.
- SupportsStop being the code review bottleneckAdd a PR auto-stamper
- SupportsStampHog PR approval agent source code and documentationcommit 988c9031bb93c74bafcdfb670c01497c79a4f644, tools/pr-approval-agent/README.md, How it works
- Headline claim
- Statement type
- Metric
- Provenance
- Reported
- Confidence
- Medium
- Confidence reason
- PostHog reports two different windows in its July 9, 2026 article; exact monthly and quarterly boundaries are not supplied.
- Reported by
- PostHog
- Scope
- Monthly PRs handled autonomously and quarterly final approvals in the main repository
- Denominator
- Merged main-repository PRs for the quarterly share; absolute handled PRs for the monthly count
- Method
- Company-reported production usage
- Observation date
- 2026-07
- SupportsStop being the code review bottleneckPreserved content.md, lines 105, 118
- Harness
- Statement type
- Fact
- Provenance
- Reported
- Confidence
- High
- Confidence reason
- A linked first-party source states the claim.
- SupportsStampHog PR approval agent source code and documentationcommit 988c9031bb93c74bafcdfb670c01497c79a4f644, tools/pr-approval-agent/README.md, How it works and Architecture
- Model
- Statement type
- Fact
- Provenance
- Reported
- Confidence
- High
- Confidence reason
- A linked first-party source states the claim.
- SupportsStampHog PR approval agent source code and documentationcommit 988c9031bb93c74bafcdfb670c01497c79a4f644, tools/pr-approval-agent/README.md, LLM Review
- Interfaces
- Statement type
- Fact
- Provenance
- Reported
- Confidence
- High
- Confidence reason
- A linked first-party source states the claim.
- SupportsStampHog PR approval agent source code and documentationcommit 988c9031bb93c74bafcdfb670c01497c79a4f644, tools/pr-approval-agent/README.md, Usage
- Tool access
- Statement type
- Fact
- Provenance
- Reported
- Confidence
- High
- Confidence reason
- A linked first-party source states the claim.
- SupportsStampHog PR approval agent source code and documentationcommit 988c9031bb93c74bafcdfb670c01497c79a4f644, tools/pr-approval-agent/README.md, LLM Review
- Knowledge
- Statement type
- Fact
- Provenance
- Reported
- Confidence
- High
- Confidence reason
- A linked first-party source states the claim.
- SupportsStampHog PR approval agent source code and documentationcommit 988c9031bb93c74bafcdfb670c01497c79a4f644, tools/pr-approval-agent/README.md, Tiers and Empirical basis
- Credentials
- Statement type
- Fact
- Provenance
- Reported
- Confidence
- High
- Confidence reason
- A linked first-party source states the claim.
- SupportsStampHog PR approval agent source code and documentationcommit 988c9031bb93c74bafcdfb670c01497c79a4f644, tools/pr-approval-agent/README.md, Usage and final verdict
- Context management
- Statement type
- Fact
- Provenance
- Reported
- Confidence
- High
- Confidence reason
- A linked first-party source states the claim.
- SupportsStampHog PR approval agent source code and documentationcommit 988c9031bb93c74bafcdfb670c01497c79a4f644, tools/pr-approval-agent/README.md, Usage and Evidence bundle
- Supporting component
- Statement type
- Fact
- Provenance
- Reported
- Confidence
- High
- Confidence reason
- A linked first-party source states the claim.
- SupportsStampHog PR approval agent source code and documentationcommit 988c9031bb93c74bafcdfb670c01497c79a4f644, tools/pr-approval-agent/README.md, How it works
- Supporting component
- Statement type
- Fact
- Provenance
- Reported
- Confidence
- High
- Confidence reason
- A linked first-party source states the claim.
- SupportsStop being the code review bottleneckAdd a PR auto-stamper
- SupportsStampHog PR approval agent source code and documentationcommit 988c9031bb93c74bafcdfb670c01497c79a4f644, tools/pr-approval-agent/README.md, LLM Review
- Supporting component
- Statement type
- Fact
- Provenance
- Reported
- Confidence
- High
- Confidence reason
- A linked first-party source states the claim.
- SupportsStampHog PR approval agent source code and documentationcommit 988c9031bb93c74bafcdfb670c01497c79a4f644, tools/pr-approval-agent/README.md, Evidence bundle
- Key observation
- Statement type
- Metric
- Provenance
- Reported
- Confidence
- Medium
- Confidence reason
- July 9 is the report date; the source says last month without exact measurement boundaries.
- Reported by
- PostHog
- Scope
- PRs handled autonomously in the previous month, as reported on July 9, 2026; exact boundaries unspecified
- Denominator
- Not reported
- Method
- Company-reported production usage
- Observation date
- 2026-07-09
- SupportsStop being the code review bottleneckPreserved content.md, lines 118
- Key observation
- Statement type
- Metric
- Provenance
- Reported
- Confidence
- Medium
- Confidence reason
- A linked first-party source states the claim.
- Reported by
- PostHog
- Scope
- Main-repository merged PRs receiving StampHog final approval during the reported quarter
- Denominator
- Merged PRs in the main repository
- Method
- Company-reported production usage
- Observation date
- 2026-07
- SupportsStop being the code review bottleneckPreserved content.md, lines 105
- Key observation
- Statement type
- Metric
- Provenance
- Reported
- Confidence
- Medium
- Confidence reason
- A linked first-party source states the claim.
- Reported by
- PostHog
- Scope
- PostHog PRs approved by StampHog and monthly token cost in the July 28, 2026 report
- Denominator
- PostHog PRs in the report's scope
- Method
- Company-reported production usage and token spend
- Observation date
- 2026-07
- Supports10,000 PRs a month is easy: How devex is evolving at PostHogPreserved content.md, lines 131
- Lesson
- Statement type
- Inference
- Provenance
- Catalog judgment
- Confidence
- High
- Confidence reason
- The source code explicitly implements and documents this safety invariant.
- SupportsStampHog PR approval agent source code and documentationcommit 988c9031bb93c74bafcdfb670c01497c79a4f644, tools/pr-approval-agent/README.md, How it works
- Lesson
- Statement type
- Inference
- Provenance
- Catalog judgment
- Confidence
- High
- Confidence reason
- The source code documents calibration against historical approval outcomes.
- SupportsStampHog PR approval agent source code and documentationcommit 988c9031bb93c74bafcdfb670c01497c79a4f644, tools/pr-approval-agent/README.md, Tiers and Empirical basis
- Lesson
- Statement type
- Inference
- Provenance
- Catalog judgment
- Confidence
- High
- Confidence reason
- The source code explicitly documents fail-closed and retry behavior.
- SupportsStampHog PR approval agent source code and documentationcommit 988c9031bb93c74bafcdfb670c01497c79a4f644, tools/pr-approval-agent/README.md, Usage
- Operating model assessment
- Statement type
- Inference
- Provenance
- Catalog judgment
- Confidence
- High
- Confidence reason
- Eligible pull requests are approved automatically; risky or ambiguous cases are refused or routed to a human.
- Observation date
- 2026-07-09