Internal employee agents
HR records, calendar scheduling and profile updates limited by role, team and data classification.
An internal assistant helps employees. It can schedule meetings on their behalf, read HR records only for HR staff on the same team, and never read restricted records.
1. Register actions and resource types
In the dashboard, open Actions & resources. Register each resource type, then each action. To paste an attribute schema, switch the attribute editor to JSON.
Resource type hr_record: attributes
{
"team_id": { "type": "id", "required": true },
"data_classification": { "type": "enum", "values": ["internal", "confidential", "restricted"], "required": true }
}Resource type calendar: attributes
{
"owner_id": { "type": "id", "required": true }
}Action hr.records.read on hr_record: context attributes
{
"requester_team_id": { "type": "id", "required": true },
"requester_role": { "type": "enum", "values": ["employee", "hr", "manager"], "required": true }
}Action calendar.schedule on calendar, no context attributes
Action employees.profile.update on hr_record, no context attributes
2. Policy
Replace <YOUR_POLICY_ID> with a new policy ID, then
validate, test and publish it with reqlo policies push --publish.
id: <YOUR_POLICY_ID>
name: Internal assistant
rules:
- id: hr-same-team
effect: allow
actions: [hr.records.read]
condition: context.requester_role == "hr" && resource.attributes.team_id == context.requester_team_id
- id: no-restricted
effect: deny
actions: [hr.records.read, employees.profile.update]
condition: resource.attributes.data_classification == "restricted"
- id: schedule-own-calendar
effect: allow
actions: [calendar.schedule]
require_delegation: true
condition: resource.attributes.owner_id == subject.id3. Authorize on the server
const employee = await directory.get(session.userId); // role and team from your directory
await reqlo.enforce({
agent: { id: "agt_hr_assistant" },
subject: { id: employee.id, kind: "employee" },
action: "hr.records.read",
resource: { type: "hr_record", id: record.id, attributes: { team_id: record.teamId, data_classification: record.classification } },
context: { requester_team_id: employee.teamId, requester_role: employee.role },
});Notes
- Role and team come from the employee directory (
provenance: server), not from the employee's message. - Calendar scheduling requires a delegation the employee granted. See Delegated access.
Every example uses the same request model; only the customer-defined actions, resources and attributes differ. See Core concepts.
Something wrong or unclear? Report an issue with this page.