Skip to content

Add AI policies to Policy Workbench #9057

Open

Description

@vitormattos

Goal

Add the LibreSign AI policy definitions and Policy Workbench integration required to control which AI-assisted capabilities may be used at system, group and user scopes.

This work must implement the policy contract established by the AI foundation rather than creating a separate permission system.

Policy model

Use the existing Policy Workbench architecture and delegation semantics.

The backend remains the source of truth for:

  • effective values;
  • system/group/user scope;
  • whether a lower level may customize a value;
  • delegation metadata;
  • allowed values;
  • editability for the current actor;
  • validation on save.

The frontend must not invent permissions or fallback rules when policy metadata is missing.

Granularity

The policy structure should distinguish materially different AI capabilities so administrators can make different risk decisions.

Potential capability groups include:

  • signature appearance/template assistance;
  • document understanding;
  • document questions;
  • field/recipient suggestions;
  • Context Chat exposure;
  • agent actions.

Do not create policy controls for capabilities that are not implemented or about to be consumed. Keep the definition extensible through the normal policy architecture.

A compound parent such as an overall artificial-intelligence policy may be appropriate if it follows the current Policy Workbench contract. Use backend definitions/metadata as the source of truth rather than hard-coded frontend child lists.

External/public actors

Follow the actor/context semantics defined by the foundation contract.

The policy model must make the authorization decision explicit for public/external signing contexts rather than relying on whether a user has a normal Nextcloud session.

Security

  • Enforce effective policy server-side at every AI operation boundary.
  • Frontend visibility or disabled controls do not replace backend checks.
  • Missing/failed policy resolution must not silently widen access.
  • Client-supplied scope/group/user context must be validated by the server.
  • AI cannot change or reinterpret its own policy.

UX

Use the existing Policy Workbench patterns.

The UI must make it understandable that:

  • Nextcloud determines whether a technical AI capability exists;
  • LibreSign policy determines whether it may be used;
  • delegation/customization follows normal LibreSign policy semantics.

Do not add provider API-key/model configuration to LibreSign.

Tests

Cover:

  • system allow/deny;
  • group inheritance and allowed override;
  • user inheritance and allowed override;
  • non-editable lower-level policy;
  • effective-value resolution;
  • unauthorized save rejection;
  • AI action rejected server-side despite technical capability;
  • external/public actor behavior defined by the contract;
  • compound-policy metadata behavior if used.

Include focused frontend tests and backend policy/authorization tests following the existing Policy Workbench test architecture.

Documentation

The user/admin documentation task must explain the policy hierarchy and delegation in product terms. This issue should only add developer-facing details needed to maintain the policy contract.

Done when

  • AI policy definitions use the existing Policy Workbench architecture.
  • Effective authorization is enforced server-side.
  • System/group/user delegation and customization follow existing semantics.
  • Capability granularity matches implemented LibreSign AI uses.
  • Frontend does not carry a competing list of policy relationships/permissions.
  • Automated tests cover inheritance, delegation and denial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend workfrontendFrontend workjavascriptWork involving JavaScript codephpWork involving PHP code

    Type

    Fields

    Priority

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions