Skip to content

API Reference parrot.integrations.liveavatar.optin

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.integrations.liveavatar.optin

View source

Per-tenant opt-in gating for LiveAvatar LITE mode (FEAT-242 Phase A — Module 7).

Provides is_avatar_enabled(tenant_id, agent_name) -> bool, the single public interface all callers use to decide whether avatar mode may be activated for a given tenant + agent combination.

Default-deny: if opt-in cannot be resolved, avatar mode is OFF.

Interim implementation — env/config-driven allowlist

The permanent flag location (program DB table, NavConfig, or a dedicated feature-flag service) is unresolved as of FEAT-242 Phase A (Q-tenant).

Interim source: two environment variables control the allowlist:

LIVEAVATAR_ENABLED_TENANTS Comma-separated list of tenant IDs that may use avatar mode, e.g.::

    LIVEAVATAR_ENABLED_TENANTS=acme,demo,internal-qa

Set to ``*`` to opt-in ALL tenants (use only in development/staging).
Absent or empty → no tenant is enabled (default-deny).

LIVEAVATAR_ENABLED_AGENTS Optional comma-separated list of agent names (slugs) that must also match. If absent, any agent name is allowed for an enabled tenant. If set, BOTH tenant_id AND agent_name must appear in their respective lists.

Resolution order (first match wins):

  1. Wildcard * in LIVEAVATAR_ENABLED_TENANTS → allow all tenants.
  2. tenant_id appears in LIVEAVATAR_ENABLED_TENANTS AND (if LIVEAVATAR_ENABLED_AGENTS is set) agent_name appears there.
  3. Otherwise → deny.

TODO Q-tenant — Owner: Jesús.

Replace the env allowlist with the authoritative program flag location

once agreed. Candidates:

a) A liveavatar_enabled column on the Navigator program/tenant table.

b) A NavConfig key per tenant (e.g. programs.<id>.avatar.enabled).

c) An external feature-flag service (LaunchDarkly / GrowthBook).

The is_avatar_enabled interface is stable — only the backing store

changes. No callers need updating.

Function is_avatar_enabled

Return True iff avatar mode is enabled for the given tenant + agent.

Default-deny: any unresolvable or unknown input returns False.

TODO Q-tenant — replace body with authoritative flag lookup once the

program DB column / NavConfig key / feature-flag service is agreed.

is_avatar_enabled(*, tenant_id: Optional[str], agent_name: Optional[str] = None) -> bool

Parameter Type Default Description
tenant_id Optional[str] Identifier for the tenant/program requesting avatar mode. None or empty string → deny (cannot resolve to any allowlist entry).
agent_name Optional[str] None Optional agent slug to match against LIVEAVATAR_ENABLED_AGENTS. When the env var is not set, any agent name is accepted for an enabled tenant.

Returns: bool — True if the tenant (and optionally the agent) is opted-in. False in all other cases.

Function is_fullmode_enabled

Return True iff FULL mode avatar is enabled for the given tenant + agent.

FULL mode opt-in is a superset of the base avatar opt-in:

  1. is_avatar_enabled() must return True (base gate).
  2. LIVEAVATAR_FULLMODE_ENABLED_TENANTS must allow the tenant.

Default-deny: if the base gate fails, or if LIVEAVATAR_FULLMODE_ENABLED_TENANTS is absent/empty, FULL mode is OFF.

TODO Q-tenant — replace body with authoritative flag lookup once the

storage layer is agreed (same as is_avatar_enabled).

is_fullmode_enabled(*, tenant_id: Optional[str], agent_name: Optional[str] = None) -> bool

Parameter Type Default Description
tenant_id Optional[str] Identifier for the tenant/program requesting FULL mode. None or empty string → deny.
agent_name Optional[str] None Optional agent slug forwarded to the base gate.

Returns: bool — True if both the base avatar gate and the FULL mode gate allow the tenant. False in all other cases.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally