AI Agent Activity Lens
AI Agent Activity Lens is a WordPress security and observability plugin for monitoring REST API activity authenticated through Application Passwords.
by Marija Lekić · github.com/lolifoks/ai-agent-activity-lens
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/lolifoks/ai-agent-activity-lens/archive/refs/heads/main.zipReadme
AI Agent Activity Lens
AI Agent Activity Lens is a WordPress security and observability plugin for monitoring REST API activity authenticated through Application Passwords.
Why I built it
WordPress Application Passwords allow external tools and AI agents to access the REST API, but WordPress does not provide a detailed per-credential activity log or rate limiting.
This plugin adds visibility and guardrails without replacing WordPress authentication or the official MCP Adapter.
Features
- Logs REST requests authenticated through Application Passwords
- Records credential, user, route, HTTP method, status, duration, IP, and timestamp
- Lets administrators tag credentials as AI-agent credentials
- Filters the dashboard to tagged credentials
- Applies configurable per-credential rate limits
- Returns HTTP 429 when a tagged credential exceeds its limit
- Automatically removes activity older than the configured retention period
- Uses WordPress capabilities, nonces, prepared queries, user meta, transients, and WP-Cron
How it works
- WordPress authenticates an Application Password.
- The plugin captures the credential UUID and user ID.
- REST requests using that credential are logged.
- Tagged AI-agent credentials can be filtered and rate-limited.
- Old activity rows are deleted daily according to the retention setting.
Screenshots
Add screenshots here after capturing:
- Activity dashboard
- Tagged-only filter
- User-profile credential tagging
- Rate-limit and retention settings
- HTTP 429 response
Installation
- Download or clone the repository.
- Copy
ai-agent-activity-lensintowp-content/plugins/. - Activate AI Agent Activity Lens.
- Create an Application Password for a WordPress user.
- Mark the credential as an AI-agent credential from the user profile.
- Configure rate limiting under Settings > AI Activity Lens.
Application Passwords require HTTPS, or a WordPress environment configured as local.
Development setup
The plugin was developed against a local Docker Compose WordPress environment with MariaDB and WP-CLI.
Example authenticated request:
curl -u "username:application-password" \
http://localhost:8080/wp-json/wp/v2/users/me