Product analytics connector

PostHog connector for governed AI agent access

Connect PostHog with the PostHog app host URL, a personal API key, and project ID.

API

Direct answer

OneQuery supports PostHog for governed agent access.

Teams use the PostHog connector to give AI agents bounded source API calls for endpoint-specific context while OneQuery keeps credentials centralized, limits access to approved sources, and preserves audit logs for review.

Agent workflow

What this connector enables

PostHog becomes an approved OneQuery source instead of a secret copied into an agent prompt, shell session, or model tool. The agent receives a governed access path, and the source credentials stay behind OneQuery.

  • Use bounded source API calls for endpoint-specific context for product analytics context.
  • Keep PostHog credentials centralized and out of agent runtimes.
  • Review agent access through OneQuery audit history instead of reconstructing direct service usage.

Setup checklist

Prepare the PostHog connection

Use posthog credentials and connect the source through the Dashboard and CLI. Keep credentials scoped to the data the agent is allowed to read.

  1. Open the PostHog project you want to connect, then go to `Settings -> Project -> General` and copy the `Project ID` from the `Project token & ID` section.
  2. Use the PostHog app origin as `credentials.hostUrl`: `https://us.posthog.com` for US Cloud, `https://eu.posthog.com` for EU Cloud, or your self-hosted base URL. Do not use the SDK `api_host` value such as `https://us.i.posthog.com`.
  3. Go to `Settings -> Account -> Personal API keys`, create a personal API key, and make sure `Organization & project access` includes the project you plan to connect.
  4. Grant at least `Read` access to `Project` and `Query`, then copy the secret immediately into `credentials.personalApiKey`. PostHog may only show the full key once.
  5. Use the canonical host URL without a trailing slash when possible; the server still normalizes extra trailing slashes.

FAQ

PostHog connector questions

What is the OneQuery PostHog connector?

The OneQuery PostHog connector makes product analytics context from PostHog available to AI agents through bounded source API calls for endpoint-specific context. Connect PostHog with the PostHog app host URL, a personal API key, and project ID.

How do AI agents access PostHog through OneQuery?

Agents call OneQuery instead of receiving raw PostHog credentials. OneQuery keeps credentials centralized, applies source boundaries, and records access in audit logs while exposing bounded source API calls for endpoint-specific context.

How do I set up the PostHog connector?

Prepare posthog credentials and connect PostHog from the OneQuery dashboard or CLI. Start with this setup step: Open the PostHog project you want to connect, then go to `Settings -> Project -> General` and copy the `Project ID` from the `Project token & ID` section.