: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
ARG BASE_IMAGE=ghcr.io/posthog/posthog-sandbox-base:master
FROM ${BASE_IMAGE}
ARG IPTABLES_VERSION=1.8.10-3ubuntu2
RUN apt-get update && apt-get install -y --no-install-recommends "iptables=${IPTABLES_VERSION}" && rm -rf /var/lib/apt/lists/*
ARG PI_CODING_AGENT_VERSION=0.68.1
RUN npm install -g "@mariozechner/pi-coding-agent@${PI_CODING_AGENT_VERSION}"
# Fetch-by-SHA (not by tag) means the server only returns the specified commit; tag force-moves
# on the personal upstream cannot affect what lands here. Install via the repo's documented
# manual-copy path so nothing downstream re-resolves the SHA through a mutable name.
ARG PI_AUTORESEARCH_SHA=56e9f2ec6f0dc6f9997126e4f1d8a4223de2a534
RUN set -eux; \
src=/tmp/pi-autoresearch; \
git init -q "$src"; \
git -C "$src" remote add origin https://github.com/davebcn87/pi-autoresearch.git; \
git -C "$src" -c protocol.version=2 fetch --depth 1 origin "$PI_AUTORESEARCH_SHA"; \
git -C "$src" reset --hard FETCH_HEAD; \
mkdir -p /root/.pi/agent/extensions /root/.pi/agent/skills; \
cp -r "$src/extensions/pi-autoresearch" /root/.pi/agent/extensions/; \
cp -r "$src/skills/autoresearch-create" /root/.pi/agent/skills/; \
cp -r "$src/skills/autoresearch-finalize" /root/.pi/agent/skills/; \
rm -rf "$src"
# The exact SHA doesn't matter — the autoresearch agent just needs reasonably recent
# ClickHouse source to ground itself in, and version parity with our prod cluster isn't
# worth the coupling. But we do need to pin to *something*: the cloned tree lands in
# a context an LLM reads, so anyone who can force-push or rebase upstream's default
# branch could slip prompt-injection payloads into the image. Fetch-by-SHA (not by
# branch) means the server only returns the specified commit, so branch movement
# cannot affect what lands here. Bump by hand when the source is too stale to be useful.
ARG CLICKHOUSE_SRC_SHA=2cfc72ed95fd4594a38f5cba68d14dc20baf6951
RUN set -eux; \
dst=/opt/clickhouse; \
git init -q "$dst"; \
git -C "$dst" remote add origin https://github.com/ClickHouse/ClickHouse.git; \
git -C "$dst" -c protocol.version=2 fetch --depth 1 origin "$CLICKHOUSE_SRC_SHA"; \
git -C "$dst" reset --hard FETCH_HEAD; \
find "$dst" -maxdepth 2 -type d \
\( -name tests -o -name docs -o -name website -o -name contrib \) \
-prune -exec rm -rf {} +; \
rm -rf "$dst/.git"
CMD ["/bin/bash"]