Policy-Based Document Access with Open Policy Agent

Evaluate every request

Published Updated

Policy-Based Document Access. Evaluate every request. An identity card and policy document meet at an access gate beside a decision checklist.

Fine-grained document access needs an enforceable policy, trusted inputs, and tests across every retrieval path. Open Policy Agent can express policy decisions; the application and its integrations must enforce those decisions consistently.

Separate the decision from enforcement

Open Policy Agent (OPA) is a policy engine using the Rego language. A policy can evaluate a subject, requested action, resource attributes, and other trusted context. The calling application remains responsible for obtaining reliable inputs and applying the result.

An access rule is different from a retention or legal-hold rule. Denying a download does not preserve the document, and preserving the document does not determine who can read it. Model and test those controls separately.

Test more than the document download

Search results, snippets, metadata, previews, exports, signed links, and asynchronous jobs can expose information. Define the permitted behaviour for each path and for policy-engine or identity-provider failures.

Do not assume granular authorisation has no performance or cost effect. Evaluate the configured policy and search path with representative data, and version policy changes with tests for allowed and denied access.

Keep the product scope current

This article originally announced a v1.14.0 beta. For a new deployment, use the current FormKiQ security and governance capabilities and edition matrix instead of treating the old Pro/Enterprise announcement as current packaging.

  1. Describe

    Gather trusted identity, action, and resource context.

  2. Decide

    Evaluate the versioned policy and failure behaviour.

  3. Enforce

    Apply the outcome to every exposed representation.

Worked example

A reviewer may read documents assigned to their team, but a restricted personnel record must remain hidden. Test direct retrieval and search with that reviewer, a different team, and a revoked identity. Change the record’s classification and verify that previously generated previews or links follow the intended access policy as well.

Practical checklist

  • Use trusted attributes and reject missing or malformed context.
  • Test both permitted and denied paths.
  • Include search, metadata, previews, links, and exports.
  • Review policy changes and measure their operational effect.

Policy-Based Document Access with Open Policy Agent in practice

Useful access policy is understandable, tested, and enforced across the document lifecycle. Start with a small rule set and prove its boundaries before expanding it.

Plan a focused proof of value

Bring a representative document set, the intended users, and the acceptance criteria. Explore the relevant FormKiQ capabilities or discuss the workflow with our team.

      Start with FormKiQ Core

      The open-source foundation — API-first, deployable into your own AWS account, and free to use. Right for architecture validation and early implementation.

      Get Started Free

      Deploy FormKiQ Essentials or Advanced

      Production-ready editions for departments and complex workflows. Start with a Proof-of-Value deployment or go straight to production.

      Explore Options

      Plan an Enterprise Rollout

      For governance-heavy environments with residency, sovereignty, assurance, and multi-jurisdiction requirements. Talk to us about the right deployment model.

      Book a Call