feat(viking): restrict access to configured URI prefixes - #379
Merged
Million-mo merged 1 commit intoAug 19, 2026
Merged
Conversation
Million-mo
force-pushed
the
feat/viking-allowed-uri-prefixes
branch
2 times, most recently
from
August 18, 2026 12:08
1e97df2 to
6615fc8
Compare
Adds an allowed_uri_prefixes option to VikingCapabilityConfig that scopes shared knowledge-base access to a configured allowlist of viking://resources/... URI prefixes. The allowlist applies only to the viking://resources/ namespace: all viking_* tools and the @-mention flow reject viking://resources/ URIs outside the listed prefixes. Every other namespace (viking://user/..., including the agent's own memories/sessions/skills and other users' namespaces) is always allowed and governed by its own feature flags. Empty list (default) preserves unrestricted behavior for backward compatibility. viking_search/viking_find without a target_uri scope to the first allowed prefix when an allowlist is set.
Million-mo
force-pushed
the
feat/viking-allowed-uri-prefixes
branch
from
August 18, 2026 12:22
6615fc8 to
6c57bfe
Compare
This was referenced Aug 22, 2026
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.
Summary
Adds
allowed_uri_prefixestoVikingCapabilityConfig, an opt-in URI prefix allowlist that scopes all Viking access to configuredviking://prefixes.Previously an agent with the Viking capability could access every resource under the whole
viking://namespace — there was no way to grant read access to a single subtree (e.g.viking://resources/wiki/) without also exposingviking://resources/raw/,viking://user/*/memories/, etc.Empty list (the default) preserves the current unrestricted behavior — fully backward compatible.
What changes
When
allowed_uri_prefixesis non-empty:viking_*toolsviking_search/viking_findtarget_uri, automatically scope to the first allowed prefix; with atarget_urioutside the allowlist — rejectlist_resources()/read_resource()/resource_exists()None/Falselist_skills/read_skill/skill_existsreturn empty/false when the skills URI is out of scopeUsage
Files changed
src/wolfharness_config/capabilities.py— newallowed_uri_prefixesfieldsrc/wolfharness/capabilities/viking/__init__.py—_check_uri_allowed()+_allowed_prefix_for()helpers; guards on ResourceAccess, skills, auto-recall, profile, compaction, uploadssrc/wolfharness/capabilities/viking/tools.py— prefix check in all 15 toolssrc/wolfharness/capabilities/viking/instructions.py— access-restriction guidancetests/capabilities/viking/test_viking.py— 20 new L1 unit teststests/capabilities/viking/test_viking_integration.py— 5 new L2 integration testschangelog/unreleased/2026-08-18-viking-allowed-uri-prefixes.mdValidation
ruff check+ruff formatcleanmypyclean on changed sourcespytest tests/capabilities/viking/→ 483 passed (458 pre-existing + 25 new)pytest tests/capabilities/→ 1324 passed (no cross-module regressions)