← Back to Blog

How to Run an AI Directory & Identity Agent with OE Runtime

Search, audit, and manage users in Active Directory or LDAP with natural language. OE Runtime connects directly to your directory server, checks account health, and surfaces stale or misconfigured accounts — no IT ticket required.

📂
Step 1
Search Users
Search Active Directory for accounts created or modified in the last 30 days with status, department, and last login.
Step 2
Check Account Health
Identify disabled accounts with active memberships, stale logins, and incomplete user profiles.
Step 3
Report
Produce a directory health summary with flagged accounts and recommended remediation actions.

The Agent YAML

Create a file called agent.yaml inside a directory-identity/ directory:

name: Directory Agent
description: Search and manage users in LDAP or Active Directory
instructions: |
  You are a directory services agent. Search for users, list groups,
  retrieve account details, and manage entries in LDAP or Active Directory.
  Always confirm before making any changes.
  Complete all steps fully before writing your report.
steps:
  - name: Search Users
    content: |
      Search Active Directory for all user accounts created or modified in the last 30 days.
      Retrieve: display name, email, department, account status (enabled/disabled), and last login date.
  - name: Check Account Health
    content: |
      From the retrieved accounts:
      - Identify any accounts that are disabled but still have group memberships
      - Identify accounts with no login in the last 30 days
      - Flag accounts with missing email or department fields
  - name: Report
    content: |
      Produce a directory health summary:
      - Total accounts found
      - Number of enabled vs disabled accounts
      - Accounts flagged for review (disabled with memberships, stale logins, incomplete profiles)
      - Recommended actions for each flagged account
connectors:
  - connection_name: Active Directory
    connection_type: ldap

The Config File

Create oe-config.json in the same directory:

{
  "llm": {
    "provider": "openai",
    "model": "gpt-4o",
    "apiKey": "YOUR_OPENAI_API_KEY"
  },
  "server": {
    "enabled": false,
    "port": 3333,
    "apiKey": "your-secret-api-key"
  },
  "connectors": [
    {
      "connection_name": "Active Directory",
      "connection_type": "ldap",
      "url": "ldap://192.168.1.10:389",
      "bindDN": "cn=admin,dc=example,dc=com",
      "bindPassword": "YOUR_LDAP_PASSWORD",
      "baseDN": "dc=example,dc=com"
    }
  ]
}

Replace the url, bindDN, bindPassword, and baseDN with your Active Directory or LDAP server details. Use a read-only service account for safety when running audit queries.

Download OE Runtime

OE Runtime — Direct Downloads

Run the Agent

Windows

# Run the agent
oe-runtime-win.exe directory-identity/agent.yaml --config directory-identity/oe-config.json

macOS

# Make executable (first time only)
chmod +x oe-runtime-macos

# Run the agent
oe-runtime-macos directory-identity/agent.yaml --config directory-identity/oe-config.json

Linux

# Make executable (first time only)
chmod +x oe-runtime-linux

# Run the agent
oe-runtime-linux directory-identity/agent.yaml --config directory-identity/oe-config.json

macOS Gatekeeper: On first run, macOS may block the binary. Go to System Settings → Privacy & Security → click "Allow Anyway" next to oe-runtime-macos.

Running as an API Server

Add --serve to start OE Runtime as an HTTP server on port 3333:

oe-runtime-win.exe --serve --config directory-identity/oe-config.json

Then send a request:

curl -X POST http://localhost:3333/run \
  -H "Content-Type: application/json" \
  -d '{"yaml": "directory-identity/agent.yaml", "params": {}}'

Or import the Postman collection (download above) to test all endpoints visually.

Use Cases

Build your own agents with OE Runtime

Download OE Runtime and run any AI agent locally or as a server — no cloud required.

Get OE Runtime →