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.

540 B
Raw Blame
"""Contract types for security."""

from pydantic.dataclasses import dataclass

from .enums import Outcome, Surface


@dataclass(frozen=True)
class SubjectInput:
    """Everything a call site knows about a request. Leave a field unset when it is unknown."""

    email: str | None = None
    user_uuid: str | None = None
    organization_ids: tuple[str, ...] = ()
    ip: str | None = None


@dataclass(frozen=True)
class Decision:
    surface: Surface
    outcome: Outcome
    rule_id: str | None = None
    target_type: str | None = None