| Version | Supported |
|---|---|
| 0.3.x | ✅ |
| < 0.3 | ❌ |
Please report security vulnerabilities to the maintainers via GitHub private vulnerability disclosure. Do not open public issues for security vulnerabilities.
When you use $scope in an @agent block or <$guard scope="..."> in a template, the compiler emits a [SECURITY] warning:
[SECURITY] <tag>: @agent $scope '<scope>' declared but @aihu/auth cannot be
verified at compile time (v0.3.0). Ensure @aihu/auth is installed and
configured before deploying to production.
This is an always-warn behavior in v0.3.0 (per Amendment 7 §6.11, option c). The warning does not indicate a bug — it is a reminder that @aihu/auth must be installed and registered for scope enforcement to be active.
- Install
@aihu/authas a dependency:bun add @aihu/auth - Register the auth middleware in your server entry point before starting the agent service.
- Verify
$scopevalues match the scope definitions in youraihu.config.ts. - The compiler warning will be suppressed in a future release once build-graph detection is implemented.
If @aihu/auth is not registered and a component uses $scope:
handleToolCallreturns HTTP 401 with{ error: 'AUTH_MISSING' }.<$guard scope="...">renders nothing (fail-closed at the UI layer).
This is intentional. Do not disable this behavior.
Before using third-party .aihu templates (from npm packages, template repos, or community sources):
-
Audit
@agentblocks: Any template with an@agentblock exposes actions and signals to external tool callers. Review all$action,$prop, and$computedentries markedexpose: { read: true }orexpose: { read: true, write: true }. -
Review
$scopedeclarations: Check that$scopevalues match your application's allowed scope set. An unexpected scope (e.g.,$scope admin) in a third-party template could expose privileged actions. -
Check
$rate-limitsettings: Ensure rate limits are appropriate for your traffic volume. Missing or absent$rate-limiton high-volume endpoints may allow quota exhaustion. -
Verify
<$guard>usage:<$guard scope="...">gates DOM rendering. Ensure the scope attribute matches a legitimate, defined scope in your@aihu/authconfiguration. -
Run the audit tool (v0.4.0, planned):
bunx aihu audit:agentwill scan all SFCs for@agentblocks and produce a security report.
@aihu/arbor refuses to register live bindings from cross-origin iframes:
- When
window.parent !== windowand the parent origin differs from the current frame's origin,mount()skipsLiveBindingregistration and emits aconsole.warn. - Same-origin iframes are permitted (they share the module graph by design).
- Never combine
sandbox="allow-scripts allow-same-origin"on aihu-hosted content iframes — this combination is a security risk (allows cross-origin iframe breakout).
The $live binding mechanism is compatible with Content-Security-Policy: script-src 'self':
- No
unsafe-eval,unsafe-inline, or blob: URL evaluation at any point. __agentBindingis elided from client bundles by the compiler — this is a compiler guarantee, not a runtime defense. CI/CD pipelines should include agrep '__agentBinding'step over assembled client bundles to verify.
The componentInstanceRegistry has a default cap of 1000 bindings per tag. Exceeding this cap:
- Emits a
console.warn. - Rejects the new binding without affecting existing bindings.
- Does not evict existing bindings.
TTL-based eviction is reserved for v0.4.0 via the agent.registry.bindingTtlMs config key.