Repository navigation
fix(agent): discover bot scope and isolate skill credentials - #4
Merged
Merged
Conversation
9 tasks done
6 tasks done
9 of 39 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agents holding a confirmed personal key cannot discover its bot ID, and saved skills/tokens from other Lockbot implementations can be mistaken for this API. Add authenticated scope discovery and explicit service/skill metadata so a user can supply a skill URL, confirm enrollment in chat, and let the Agent discover its bot without scanning IDs.
Fixes #3
Behavior
GET /api/agent/context: a valid personal key resolves only its bound bot, verified actor, enabled state and relative operation links. It works for stopped or suspended bots without granting resource access. Revoked, expired, deleted-bot and identity-invalid keys remain rejected. The route has ingress and shared per-key read limits.lockbot.resource-api, API contract version, software version, skill identity and installable bundle. API responses advertise the current skill revision; Agents check at task start/reconnect and before their next mutation after a revision change.lockbot-resource-agentandlockbot-operator-agentinstallation bundles. The skills identify the approved origin without sending credentials, keep credentials private and scoped to origin/instance/bot identity, and leave other platforms' skills/tokens intact. Personal and OP manifests advertise their own credential schemes; OP keys do not gain personal context/enrollment.detail, legacy download URLs, ZIP roots and manifest fields. Add top-level auth error codes and a context URL, distinguishing wrong-bot use without breaking the released 401 body type. No existing key requires rotation or rebinding for a skill update.Compatibility and storage
The instance UUID occupies one entry in the existing site-settings table and survives normal restarts/upgrades. No resource state or credential scope is migrated. Older 2.10.0 servers retain the documented approved-bot configuration fallback; clients never scan IDs or try another platform's token/API. Public service identifiers prevent accidental confusion; the user-approved origin remains the credential destination boundary.
The public design note includes the acceptance checklist for discovery, compatibility, updates and coexistence. This PR is independent of the legacy state-file migration in PR #2.
Validation
Deployed to the isolated nightly test service only; not merged or formally released. The existing production service is unchanged.
Live verification used an existing retained mock key to discover its bot without an ID, verified both ZIP downloads and hashes, checked the wrong-bot/invalid-key cases, acquired a free fictional resource with Agent/task metadata, then released it and verified task cleanup. Both operation notifications were confirmed in the authorized test group. A subsequent service restart preserved the instance ID, bot configurations and existing credentials. The chat authorization success message now omits the bot ID; it remains available to the Agent through context.