Interface AiActor


public interface AiActor
Who the user is that triggered an AI run. Produced by the entry point that received the request — an RPC, a script call, a Perspective session, an API token — and consulted by whatever restricted tool or resource requires a permission check.

An actor is always handed to the code that uses it — through AiContext.HarnessBuilder.actor(Supplier) for an agent run, or as a parameter on the MCP protocol path. There is deliberately no ambient "current" or thread-local actor to read or publish: code deep in a call chain cannot claim an identity it was not given.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final AiActor
    Holds no security levels.
  • Method Summary

    Modifier and Type
    Method
    Description
    Short, human-readable identification of this actor for denial diagnostics and audit — e.g.
    boolean
     
  • Field Details

    • ANONYMOUS

      static final AiActor ANONYMOUS
      Holds no security levels. The stand-in for a caller whose identity is unknown, and what a harness uses when its builder was given no actor.

      Evaluates gates honestly rather than refusing outright, so an ungated tool stays reachable and a gated one does not — the same answer an anonymous session gets. Refusing outright would strip every tool from harnesses that have no user behind them by design, such as the Designer chat and the diagnostic digest agents.

  • Method Details

    • isAuthorizedFor

      boolean isAuthorizedFor(PermissionsConfig permissions)
      Parameters:
      permissions - the gate configured on the resource being reached.
      Returns:
      true if this actor satisfies permissions.
    • descriptor

      String descriptor()
      Short, human-readable identification of this actor for denial diagnostics and audit — e.g. "perspective:<sessionId>" or "api-token:<name>". Not an identity to authorize against; use isAuthorizedFor(PermissionsConfig) for that.