Goldnat AI Connect for XenForo

Goldnat AI Connect for XenForo 1.2.52

No permission to download
This release aligns OAuth scope handling with the SERVIO principle (the token is an identity credential; per-request permission is authoritative) and adds several security and reliability fixes accumulated since 1.2.44.

Highlights

  • SERVIO-aligned permissions — admin/write operations are now authorized per-request by the acting user's actual role, not by a scope tag baked into the token. This fixes cases where legitimate admins were blocked from operations they could perform manually in the ACP.
  • OAuth scope handling (RFC 6749 §3.3) — the authorization server now grants the subset of requested scopes the client is allowed, instead of rejecting the whole request when one scope is unknown. Tokens with legacy scope formats are also read correctly.
  • Conversation privacy — startConversation and replyToConversation now enforce per-recipient privacy (ignore lists, block lists, permission checks) via XenForo's native can*() checks.
  • Reliability self-heal — the addon rebuilds its own listener and route caches on upgrade, preventing Bearer auth or routing from silently breaking after cache regressions.
  • Prompt generator — the built-in token generator now grants the maximum scope the client is allowed, so hand-fed tokens work with every installed tier.
  • Code cleanup — PSR-12 style pass; no functional change.

Upgrade notes

No breaking changes for correctly-configured sites. Existing tokens continue to work. After upgrading, if you use the Admin add-on, remember that its tools require the relevant AI Connect permissions to be granted to your admin user group (ACP → Groups → User group permissions → AI Connect), then rebuild the permission cache.

Requires XenForo 2.3+ and PHP 8.0+.
Put together a short demo showing what a cross-platform request actually looks like end to end.

The prompt:
"Check my Shopify sales this week, write a blog post about the top-selling
product, and open a discussion about it in my customer forum 'Community'"

What happens:
1. Agent pulls this week's Shopify sales and finds the top seller
2. Writes and publishes a WordPress blog post about it
3. Finds the right forum on the connected XenForo board and opens a
discussion thread — through AI Connect, as a real member account,
under that member's existing permissions

Same conversation, same agent, three platforms — each authenticated
separately, nothing shared between tokens.

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.

Token management and a real search engine​


This release closes a fourteen-version gap since 1.2.26. The headline items are member-facing token management and a rebuilt search engine.

Members can now manage their own AI tokens​


Until now, a member who connected an AI agent had no way to see what they had authorised, or to disconnect it. That is fixed.

Under AI Connect → My AI Tokens in the account area, members can see every token they hold, when it was last used, from which IP address, and with which client. Revoking is one click.

The menu entry only appears for members who actually hold tokens, so it stays invisible to everyone else.

Six filters keep long lists usable: Active, Renewable, Unused, Inactive, Revoked and All. The Renewable filter deserves a mention — it surfaces tokens whose access window has expired but whose refresh token is still alive. Those tokens still work, and previously there was no way to tell.

Administrators get the same picture across all users under Setup → AI Connect → Tokens, including bulk revoke that respects whichever filter is active.

Search that understands what you asked for​


Search runs through XenForo's own search engine, which changes both what you can ask for and what comes back.

Both search tools now accept the syntax your members already use on the forum:

  • "exact phrase" — quoted terms match as a phrase, not as separate words
  • +required — the term must appear
  • -excluded — the term must not appear

Results come back ranked by relevance rather than only by date, and responses now carry the total number of matches, the current page, and whether more remain. Previously an agent asking for ten results had no way to know whether ten was all there was.

That also fixes a quiet failure. The old implementation fetched a batch, filtered out whatever the connected member was not allowed to see, and returned whatever survived. On a forum where much of the content is restricted, that returned fewer results than requested without saying so — an agent could reasonably conclude the content did not exist. Permission filtering now happens inside the search itself, so a full page is a full page.

Matching inside words. A full-text engine matches whole words, which is correct for English but wrong for languages that attach prefixes directly onto a word — searching for a base word would find nothing, because the indexed word carries a prefix the searcher never typed. The tools handle both: the engine runs first, and if it finds nothing the search retries as a substring match, which finds a base word inside its longer forms. A match_mode parameter forces either behaviour when you need it, and the response reports which was used.

Fixes​


1.2.40 — Connection prompt lists the parameters each tool accepts, derived from the tool definitions
1.2.39 — Substring matching restored alongside the engine, so a base word is still found inside its prefixed forms
1.2.38 — Search moved onto XenForo's search engine: phrase syntax, relevance ranking, paging with a true total
1.2.37 — Multi-word queries split into terms instead of being matched as one literal string
1.2.37 — getCurrentUser also reports the primary user group and administrator status
1.2.36 — Permission labels in the admin panel showed raw internal keys in some installs; now readable and translatable
1.2.35.2 — Legacy pre-1.2.31 tokens are auto-revoked on upgrade
1.2.35.1 — Token registry backfilled for pre-1.2.31 tokens
1.2.35 — Renewable tokens: refresh-alive tokens shown separately after the access window expires
1.2.35 — Revoke now cascades to the OAuth refresh token (security fix)
1.2.35 — Bulk revoke respects the active filter, with a confirmation dialog
1.2.34 — User-facing token management UI, bulk revoke, lazy cleanup
1.2.34 — "My Tokens" added as a sub-navigation item under AI Connect
1.2.34 — Navigation entry hides itself when the member holds no tokens
1.2.33 — Connection prompt now includes the refresh token, so first-time setup completes without manual steps
1.2.31 — Per-tool permission IDs rebuilt to prevent collisions
1.2.30 — Schema migration made resilient for installs that skipped intermediate versions
1.2.29 — Version bump and hash rebuild
1.2.28 — Resolved a PSR-1 side-effects warning reported by static analysis
1.2.28 — Rebuilt hashes.json to correct doubled paths
1.2.26 — Permission description added for viewAiConnect

One fix needs your attention after upgrading. Per-tool permission IDs were truncated to 25 characters, which meant two tools whose names shared a long prefix could end up with the same ID — disabling one silently disabled the other. IDs are now derived from a hash of the full tool name and are guaranteed unique.

If you previously disabled individual tools, please re-check those settings. The old behaviour may have disabled more than you intended.

Two smaller corrections worth noting. Permission entries for tool groups displayed raw internal keys instead of readable names in some installs — they now display correctly and can be translated like any other phrase. And the generated connection prompt now lists the parameters each tool accepts; previously only a handful carried that detail and the rest appeared as bare names, which could lead an agent to assume a tool took no arguments.

What this add-on exposes​


Five read-only tools:

  • searchThreads — search threads
  • getThread — read a thread
  • searchPosts — search posts
  • getPost — read a post
  • getCurrentUser — identify the connected account

You control access from the admin panel​


Access is managed through XenForo's own permission system, exactly like every other add-on.

Under Groups & Permissions you decide which user groups may use AI Connect at all, and which of the five tools each group can reach. Every tool has its own permission entry. A group can be allowed to search threads but not read posts, if that is what you want.

On top of that, XenForo's existing content permissions still apply. An agent connected as a given account cannot see a node, thread or post that the account could not already see through the web interface. The add-on adds no privileged path of its own.

Managing what an agent actually uses: goldnat.ai​


The permissions above define what an account may do. A separate question is what a specific AI agent should do with that account — and that is where https://goldnat.ai comes in.

It lets you narrow an agent's reach to a subset of what has already been exposed to it:

  • Per-agent tool control — grant one agent read-only access and another the full set, from the same account
  • Token lifecycle — issue, refresh and revoke in one place, with an audit trail
  • Multiple sites under one account, each scoped independently
  • Per-site rate limiting

The two layers work together: XenForo decides what is possible, goldnat.ai decides what a given agent is permitted to touch within that. Neither can grant more than the other allows.

Using goldnat.ai is optional. The add-on speaks a standard protocol and works with any compatible client — your XenForo permissions apply either way.

Upgrading​


Standard XenForo upgrade — upload the files, run the upgrade from the Add-ons page. Settings and permissions are preserved.

Two things to expect:

  1. Members holding pre-1.2.31 tokens will need to reconnect once
  2. If you had disabled individual tools, confirm those settings still match your intent
  3. Tools may briefly return a permission error until XenForo rebuilds its permission cache. On an active forum this resolves itself within minutes; if background tasks are disabled on your board, rebuild permissions manually. This is not a fault in the add-on, but it looks like one if you are not expecting it

Need write access?​


This add-on is read-only by design. Posting, moderation, conversations, attachments and forum discovery are handled by AI Connect Pro, which installs alongside this one and requires it.
Version 1.2.26 — Permission system overhaul, Admin CP visual improvements, and critical bug fixes.

🔧 Critical Fixes
  • Fixed: allowUnauthenticatedRequest must be public — PHP fatal error on every tool API call. The method visibility was protected instead of public, causing a crash when XenForo's API framework invoked it.
  • Fixed: Missing permissions after upgrade — useTools and viewAiConnect could silently disappear from the database after an addon upgrade or manual admin panel reset. The installer now restores missing or "unset" critical permissions on every upgrade while preserving explicit admin choices (Allow/Deny).

✨ New Features
  • Three-state permission greying in Admin CP — The permission editor now shows three visual states for per-tool permissions:
    • Allow — normal (white, interactive)
    • Not Set — dimmed (60% opacity, help cursor, tooltip: "No effect while master switch is Not Set")
    • Never — disabled (35% opacity, clicks blocked, tooltip: "Blocked by Never")
    This helps administrators understand that setting tool permissions has no effect unless the master switch (useTools) is set to Allow.
  • Info page permission-aware display — The /ai-connect page now shows context-appropriate messages instead of a generic 403 error:
    • Users with useTools: full page with Generate Token button
    • Logged-in without permission: page with "You do not have permission" message
    • Anonymous (toggle ON): page with "Log in to generate a token" link
    • Anonymous (toggle OFF): standard 403
  • Permission descriptions in Admin CP — viewAiConnect now shows an explanatory note: "Controls visibility for guests only. Requires the navigation toggle to be enabled."

🔒 Permission Logic Changes
  • Navigation link: Anonymous users see the link when aiconnect_nav_top is ON + viewAiConnect = Allow. Logged-in users need useTools permission.
  • Info page access: Logged-in users always reach the page (template handles the message). Anonymous users are gated by the navigation toggle.
  • Token generator + OAuth section: Only shown to users with useTools permission.

📋 Upgrade Notes
  • Standard addon upgrade: php cmd.php xf:addon-upgrade chgold/AIConnect
  • If you previously had permission issues (403 on info page, missing nav link), this version auto-repairs the default permissions on upgrade.
  • Clear browser cache to see the updated Admin CP permission greying (JS change).

Full changelog and source: GitHub | Documentation
  • Like
Reactions: jabber
Re-uploading v1.2.21 as a direct file attachment. Functionality is identical to the previous release — no code changes.
### Version 1.2.21 — 2026-04-14
* Fixed: Users with useTools = Never can no longer access the AI Connect info page or generate tokens

### Version 1.2.20 — 2026-04-14
* Fixed: Navigation link and footer icon are now automatically hidden for users/groups with useTools = Never

### Version 1.2.19 — 2026-04-14
  • Fixed: Admin CP permission greying now works on fresh installs — switched to direct click listeners matching XenForo's own PermissionChoice approach
  • Fixed: js/chgold/aiconnect/admin-permissions.js was missing from the release ZIP on fresh installs (added build.json with additional_files)

### Version 1.2.18 — 2026-04-14
* Fixed: PRO tool phrases were incorrectly stored under the free addon's addon_id, causing XenForo phrase validation errors (a-z, A-Z, 0-9, _ only) on fresh installs of external sites

### Version 1.2.17 — 2026-04-14
  • Added: Generic prompt metadata system — each module declares its own getToolPromptMeta() so future tools appear automatically in the personalised prompt
  • Improved: buildPersonalizedPrompt() collects tool hints and URL examples from modules at runtime instead of a hardcoded table

### Version 1.2.16 — 2026-04-14
  • Security: allowUnauthenticatedAccess() returning false added to the Tools API controller — unauthenticated tool execution is now explicitly blocked at the framework level
  • Fixed: Admin CP permission JS file path corrected to js/chgold/aiconnect/admin-permissions.js per XenForo static file conventions

### Version 1.2.15 — 2026-04-13
* Added: Admin CP visual permission UI — per-tool rows grey out automatically when useTools is set to Never, matching XenForo's native depend_permission_id behaviour

### Version 1.2.14 — 2026-04-13
  • Added: Permission-aware manifest — authenticated requests to /api/aiconnect-manifest return only tools the token owner can use; anonymous requests return the full list for discovery
  • Added: Permission-aware prompt generator — /ai-connect/generate-token returns a personalised prompt filtered to accessible tools

### Version 1.2.13 — 2026-04-12
  • Added: Full 3-tier permission system: viewAiConnect, useTools (master switch), per-package (use_package_{id}), per-tool (tool_{module}_{tool})
  • Added: Two Admin CP permission interface groups: AI Connect and AI Connect — Tools
  • Added: syncToolPermissions() and syncPackagePermissions() — auto-registered on install/upgrade; third-party addons can hook in via ai_connect_sync_tool_permissions

### Version 1.2.10–1.2.12 — 2026-04-12
  • Added: viewNavLink permission for controlling navigation link visibility per user group
  • Added: Session-based OAuth flow (/api/aiconnect-oauth/start + /api/aiconnect-oauth/poll)
  • Fixed: Footer template uses link() and base_url() instead of hardcoded paths
This release covers all changes since v1.1.9 — a large update with new features, major improvements, and several important bug fixes.

---

🆕 New Features

• AI Connect Info Page (/ai-connect/) — A public page on your forum showing the manifest URL, OAuth authorize URL, and step-by-step instructions for connecting AI agents. Visitors see a clean landing page; logged-in users get a ready-to-paste prompt.

• Token Generator (/ai-connect/generate-token) — Logged-in forum members can generate a Bearer token in one click via the info page, no OAuth flow required. Useful for personal API access.

• Translation Provider Admin Setting — Choose between AI Self-Translate (default, no external API), MyMemory API (~5,000 chars/day free tier), or Disabled. Configurable under Admin CP → Options → AI Connect.

• Footer Icon & Navigation Entry — AI Connect icon appears in the forum footer (next to RSS) and optionally in the top navigation bar. Both default to on; configurable in Admin CP.

• ?token= Query Parameter Auth — AI agents that can't set HTTP headers (e.g. web-based agents using URL fetching) can now authenticate via ?token=YOUR_TOKEN in the URL. Authorization: Bearer header takes priority when present.

• Claude Desktop / webmcp-client Setup — Built-in instructions in the info page and README for connecting via the webmcp-client npm package.

---

🔧 Improvements

• Universal Tool Schemas (v1.2.0) — Date filters now accept natural language ("today", "yesterday", "1week", "1month"), dynamic durations ("3d", "6h", "2w"), ISO dates ("2026-03-15"), or "all" for full history. Tools also now accept username and user_id filters, and translation uses standard ISO language codes.

• until= Date Filter (v1.2.2) — Closed time windows: combine since= and until= to search within a specific date range (e.g. since=1week&until=yesterday).

• Fuzzy client_id Matching — Supports common AI client variants: gemini_client, claude_ai, chatgpt_client, openai, google, etc. All resolve to the correct registered client automatically.

• Registered Clients in Manifest — The manifest now exposes the list of registered client IDs, so AI agents can discover the correct client_id to use without guessing.

• Improved AI Agent Prompts — The info page and generated token prompts include better documentation: tool examples, date filter syntax, username search, MCP connection instructions.

---

🐛 Bug Fixes

• [Critical] Rate Limiter — isRateLimited() was returning a truthy array instead of a boolean, causing every request to return HTTP 429 Too Many Requests. All API calls were being blocked regardless of actual usage.

• [Critical] tools_endpoint URL — The manifest was pointing tool calls to the wrong controller (/api/ai-connect/v1/tools/ instead of /api/aiconnect-tools). All tool executions were silently failing with 404.

• [Critical] ?token= Auth Placement — Token query param was being checked before the auth middleware could handle it. Fixed by moving the check to the correct layer (BearerAuth).

• Fix: Duplicate Port — Info page URLs were doubling the port number when running on non-standard ports (HTTP_HOST already includes the port).

• Fix: Base URL — Info page was using the boardUrl admin option (often set to "localhost") instead of the actual request host/scheme.

• Fix: Navigation Template Variable — The conditional nav display was using $xf->options->... which caused PHP warnings; corrected to the proper template variable format.

• Fix: client_id variant aliases pre-registered on fresh install — Common variants (gemini_client, claude, claude_client, chatgpt_client) are now registered during installation so fuzzy matching works from day one.

---

Full changelog: https://github.com/chgold/xf-ai-connect/commits/main
Back
Top Bottom