Access Model

Scope

This page documents the current implementation of access control in Fred across:

  • agentic-backend
  • knowledge-flow-backend
  • fred-core security modules

It is a reference for platform administrators, security teams, and maintainers.

Identity and Claims Mapping

Input in tokenFred fieldUsage
subKeycloakUser.uidUser identity key
preferred_usernameKeycloakUser.usernameDisplay and tracing
emailKeycloakUser.emailUser profile
resource_access[client_id].rolesKeycloakUser.rolesGlobal RBAC
groupsKeycloakUser.groupsTeam membership for ReBAC contextual relations

Implementation reference:

  • fred-core/fred_core/security/oidc.py

RBAC (Global)

Actions

  • create (C)
  • read (R)
  • update (U)
  • delete (D)
  • read:global (G)
  • process (P)

Roles

RoleEffective rule
adminAll actions on all resources
editorAllowlist by resource (see table below)
viewerBaseline R on all resources, with explicit overrides
service_agentNarrow read-only subset for service use

Resource matrix (RBAC)

Resourceadmineditorviewerservice_agent
tagallC,R,U,DRR
documentallC,R,URR
documents_sourceallRR-
resourceallC,R,U,DR-
tableallC,R,U,DRR
tables_databaseallC,R,U,DRR
kpiallRR-
opensearchallRRR
neo4jall-R-
logsall-R-
filesallC,R,U,DC,R,U,D-
feedbackallCC-
prompt_completionsallCC-
metricsallRR-
agentsallRR-
agentall-R-
sessionsallC,R,U,DC,R,U,D-
message_attachmentsallC,RC,R,U,D-
mcp_serversallC,R,UR-
userallRR-
teamall-R-
organizationall-R-

Implementation reference:

  • fred-core/fred_core/security/rbac.py
  • fred-core/fred_core/security/models.py

ReBAC (Object-level)

Fred uses OpenFGA schema relations and permissions for fine-grained control.

Core model

ObjectMain permissionsRule summary
organizationcan_edit_agent_class_path, can_create_team, can_create_agentDerived from organization roles (admin, editor, viewer)
teamcan_read, can_update_info, can_update_agents, can_update_resources, member admin permsOwner/manager/member hierarchy + optional public visibility
agentread, update, deleteOwner or delegated through owner team permissions
tagread, update, delete, shareDirect role, inherited parent relation, or owner-team derived permission
documentread, update, delete, processDerived from parent tag permissions
resourceread, update, delete, shareDerived from parent tag permissions

Implementation reference:

  • fred-core/fred_core/security/rebac/schema.fga
  • fred-core/fred_core/security/rebac/rebac_engine.py

Endpoint Enforcement Snapshot

AreaAuthNRBACReBACCurrent behavior
Agentic /agents*yespartialyesAgent CRUD/list constrained mainly by ReBAC checks in service layer
Agentic chat sessions/history/attachmentsyesyesnoRBAC + strict ownership check (session.user_id == user.uid)
Agentic /config/model-routing/teams/{team_id}yesfallback admin only when ReBAC disabledyesTeam-level preview guarded by TeamPermission.CAN_UPDATE_AGENTS
Agentic MCP servers (create/update/delete/restore)yesyesnoRBAC-enforced in service
Agentic MCP servers listyesnonoAuth-only endpoint
Knowledge Flow /teams*yesnoyesTeam operations controlled by ReBAC team permissions
Knowledge Flow /usersyesyesnoRequires user:read
Knowledge Flow tags/resources/metadatayesyesyesCombined RBAC + object-level ReBAC
Knowledge Flow content preview/downloadyesyesnoRBAC document:read, no explicit object-level check in content service
Knowledge Flow models (/models/umap/*)yesnopartialSome paths indirectly constrained through metadata calls
Knowledge Flow statistic/benchmark/reportsyesnonoAuth-only functional endpoints
Knowledge Flow KPI queryyesyesnokpi:read or kpi:read:global
Health/readiness endpointsnononoPublic liveness/readiness

ReBAC Disabled Mode

When ReBAC is disabled (Noop engine):

  • has_permission(...) returns True
  • lookup APIs return RebacDisabledResult
  • services that rely on lookup filtering generally skip object-level filtering

In that mode, behavior becomes mostly RBAC-only (plus explicit ownership checks where implemented).

Implementation reference:

  • fred-core/fred_core/security/rebac/rebac_factory.py
  • fred-core/fred_core/security/rebac/noop_engine.py