> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opal.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Report AI tools seen in a browser

> **Prototype (AG-457).** Reports the AI tools one person was seen using in a browser that runs the Opal browser extension: one sighting per tool, account and day. The extension reports a tool only when a page's host is one of the tool's own hosts in Opal's catalog of AI tools (sent in the client settings), and never sends paths, page titles or page text. For an account it sends only the email domain, from which Opal decides whether the account is the organization's or personal.

A sighting tells a visit from use. Opal marks it USED when the person sent something to the tool (`uses`), SIGNED_IN when the page showed a signed-in account (`account_domain`), and VISITED when the site was only opened.

The person is the holder of the sign-in token. With the organization's hooks key, the person is the user `X-Opal-Actor` names, and a report naming no user of the organization is dropped. Answers 200 and stores nothing while shadow AI detection is off for the organization.



## OpenAPI

````yaml https://app.opal.dev/openapi.yaml post /agent-activity/ai-sightings
openapi: 3.1.0
info:
  contact:
    email: hello@opal.dev
    name: Opal Team
    url: https://www.opal.dev/
  description: >-
    The Opal API is a RESTful API that allows you to interact with the Opal
    Security platform programmatically.
  title: Opal API
  version: '1.0'
servers:
  - description: Production
    url: https://api.opal.dev/v1
security: []
tags:
  - name: access-rules
    description: Operations related to access rules
  - name: agent-activity
    description: Operations related to agent activity telemetry
  - name: apps
    description: Operations related to apps
  - name: bundles
    description: Operations related to bundles
  - name: campaigns
    description: Operations related to access review campaigns
  - name: configuration-templates
    description: Operations related to configuration templates
  - name: delegations
    description: Operations related to request reviewer delegations
  - name: event-streams
    description: Operations related to event streaming connections
  - name: events
    description: Operations related to events
  - name: groups
    description: Operations related to groups
  - name: group-bindings
    description: Operations related to group bindings
  - name: idp-group-mappings
    description: Operations related to IDP group mappings
  - name: idp-user-attribute-mappings
    description: >-
      Operations related to the user attributes Opal imports from identity
      providers and HRIS apps
  - name: ip-acl
    description: >-
      Operations related to the API IP allowlist (IP zones and its enforcement
      setting)
  - name: message-channels
    description: Operations related to message channels
  - name: non-human-identities
    description: Operations related to non-human identities
  - name: on-call-schedules
    description: Operations related to on-call schedules
  - name: opal-queries
    description: Operations related to OpalQuery
  - name: opal-scripts
    description: Operations related to OpalScripts
  - name: owners
    description: Operations related to owners
  - name: requests
    description: Operations related to requests
  - name: resources
    description: Operations related to resources
  - name: role-assignments
    description: >-
      Operations related to role assignments (general grants between an entity
      and a principal)
  - name: paladin
    description: Operations related to Paladin
  - name: service-users
    description: Operations related to service users (non-human identities owned by a team)
  - name: sessions
    description: Operations related to sessions
  - name: tags
    description: Operations related to tags
  - name: tokens
    description: Operations related to API tokens
  - name: uars
    description: Operations related to UARs. Deprecated in favor of the `campaigns` API.
  - name: users
    description: Operations related to users
paths:
  /agent-activity/ai-sightings:
    post:
      tags:
        - agent-activity
      summary: Report AI tools seen in a browser
      description: >-
        **Prototype (AG-457).** Reports the AI tools one person was seen using
        in a browser that runs the Opal browser extension: one sighting per
        tool, account and day. The extension reports a tool only when a page's
        host is one of the tool's own hosts in Opal's catalog of AI tools (sent
        in the client settings), and never sends paths, page titles or page
        text. For an account it sends only the email domain, from which Opal
        decides whether the account is the organization's or personal.


        A sighting tells a visit from use. Opal marks it USED when the person
        sent something to the tool (`uses`), SIGNED_IN when the page showed a
        signed-in account (`account_domain`), and VISITED when the site was only
        opened.


        The person is the holder of the sign-in token. With the organization's
        hooks key, the person is the user `X-Opal-Actor` names, and a report
        naming no user of the organization is dropped. Answers 200 and stores
        nothing while shadow AI detection is off for the organization.
      operationId: reportAiToolSightings
      parameters:
        - description: >-
            The identity the reporting browser claims. Used only with the
            organization's hooks key. **Unverified.**
          explode: false
          in: header
          name: X-Opal-Actor
          required: false
          schema:
            type: string
          style: simple
        - description: >-
            The browser the report came from, as the extension names it (`Chrome
            (macOS)`). **Unverified.**
          explode: false
          in: header
          name: X-Opal-Host
          required: false
          schema:
            type: string
          style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AiToolSightingsReport'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiToolSightingsResult'
          description: How many sightings were read and recorded.
        '400':
          description: >-
            The body was unparseable, or carried more sightings than one report
            may.
        '413':
          description: >-
            The request body exceeded the maximum accepted size (256 KiB; 2 MiB
            in dev).
      security:
        - BearerAuth: []
components:
  schemas:
    AiToolSightingsReport:
      description: >-
        # AiToolSightingsReport Object

        ### Description

        AI tools one person was seen using in a browser, at most 200 sightings
        per report.
      properties:
        sightings:
          items:
            $ref: '#/components/schemas/AiToolSighting'
          type: array
        dev_capture:
          $ref: '#/components/schemas/AiToolSightingsDevCapture'
      required:
        - sightings
      type: object
      additionalProperties: true
    AiToolSightingsResult:
      description: |-
        # AiToolSightingsResult Object
        ### Description
        What one sightings report did.
      properties:
        received:
          description: Sightings in the report.
          type: integer
        recorded:
          description: >-
            Sightings stored. Lower than `received` when a sighting named a tool
            that is not in the catalog, a host that is not the tool's, or a day
            that could not be read, or when shadow AI detection is off.
          type: integer
      required:
        - received
        - recorded
      type: object
    AiToolSighting:
      description: |-
        # AiToolSighting Object
        ### Description
        One AI tool seen with one account on one day.
      properties:
        id:
          description: >-
            The extension's id for this tool, account and day, the same each
            time the day is sent again. Opal keys the day on the person, the
            tool, the account's domain and the day, which this id stands for.
          type: string
        tool:
          description: The tool's key in Opal's catalog of AI tools.
          type: string
        host:
          description: The page's host, one of the tool's own hosts or a subdomain of one.
          type: string
        day:
          description: The browser's own calendar day this sighting covers, `YYYY-MM-DD`.
          type: string
        first_seen:
          description: The first time the tool was seen on that day.
          format: date-time
          type: string
        last_seen:
          description: The latest time the tool was seen on that day.
          format: date-time
          type: string
        visits:
          description: >-
            The running total of visits on that day. A later report for the same
            day replaces the day rather than adding to it, so a report sent
            again until Opal acknowledges it counts once.
          type: integer
        uses:
          description: >-
            The running total of times on that day the browser saw the person
            send something to the tool (a prompt, a message), counted from the
            tool's own send requests, matched on their method and address only.
            Like `visits`, a later report for the day replaces it. A sighting
            with no uses and no `account_domain` shows only that the tool's site
            was opened.
          type: integer
        last_used:
          description: >-
            The latest time on that day the person sent something to the tool,
            when `uses` is above 0.
          format: date-time
          type: string
        account_domain:
          description: >-
            The email domain of the account signed in to the tool, when the
            browser could read it.
          type: string
        plan:
          description: >-
            The tool's own plan name for that account (free, plus, team,
            enterprise), when known.
          type: string
        account_structure:
          description: >-
            ChatGPT's own word for the account, `personal` or `workspace`, when
            known.
          type: string
        account_hash:
          description: >-
            HMAC-SHA256 of the account's lower-cased email address under the
            organization's `account_hash_key`, in hex. It lets Opal recognize
            one account used by several people without the address ever leaving
            the browser.
          type: string
        agent:
          $ref: '#/components/schemas/AiToolSightingAgent'
        dev_capture:
          description: >-
            Dev only. What the extension captured about the page (`url`,
            `title`, `text`, `prompts`, `account_email`), sent only while client
            settings say `dev_capture`. Opal stores it only when it runs in dev
            or locally, and drops it everywhere else.
          additionalProperties: true
          type: object
      required:
        - tool
        - host
        - day
        - first_seen
        - last_seen
        - visits
      type: object
      additionalProperties: true
    AiToolSightingsDevCapture:
      description: >-
        # AiToolSightingsDevCapture Object

        ### Description

        Dev only, sent while client settings say `dev_capture`: every host the
        browser opened, and the

        AI tools' own API requests and responses. Opal stores it only when it
        runs in dev or locally,

        and drops it everywhere else.
      properties:
        hosts:
          items:
            $ref: '#/components/schemas/AiToolDevHost'
          type: array
        raw:
          description: >-
            Captured API calls, each with at least `id`, `tool`, `day` and `at`,
            stored as sent. A capture whose `id` Opal already has is not stored
            again.
          items:
            additionalProperties: true
            type: object
          type: array
      type: object
    AiToolSightingAgent:
      description: >-
        # AiToolSightingAgent Object

        ### Description

        An agent inside an AI tool that the page's address named, such as a
        custom GPT or a Claude

        project, matched by one of the tool's agent patterns.
      properties:
        kind:
          description: The kind of agent, one of the tool's agent pattern kinds.
          type: string
        id:
          description: The agent's id, the pattern's first capture group.
          type: string
      required:
        - kind
        - id
      type: object
    AiToolDevHost:
      description: |-
        # AiToolDevHost Object
        ### Description
        A host the browser opened on a day, AI tool or not.
      properties:
        host:
          type: string
        day:
          type: string
        first_seen:
          format: date-time
          type: string
        last_seen:
          format: date-time
          type: string
        visits:
          type: integer
      required:
        - host
        - day
        - first_seen
        - last_seen
        - visits
      type: object
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.