| Audience | Import from | Example |
|---|---|---|
| App and agent authors | Top-level unplug exports |
from unplug import Guard |
| Server, MCP, and dependents needing policy, cache, boundaries, or ML facades | unplug.api.* |
from unplug.api.types import ScanRequest |
| Do not use in new code | unplug.core.* |
Internal; may change in minor releases |
Use unplug.api.* for cross-repository integrations. Treat unplug.core.* and
most of unplug.ml.* as private implementation details that can move during SDK
refactors.
| Need | Public import | Previous/internal import |
|---|---|---|
| Wire types | unplug.api or unplug.api.types |
unplug.models |
| Actions / sources | unplug.api.enums |
unplug.models |
| Policy helpers | unplug.api.policy |
unplug.core.policy |
| Privacy filters | unplug.api.privacy |
unplug.core.privacy |
| Scan cache | unplug.api.cache |
unplug.core.runtime.cache, unplug.core.cache |
| Boundary wrapping | unplug.api.boundaries |
unplug.core.agent.boundaries |
| Normalization | unplug.api.normalization |
unplug.core.normalize |
| Encoded-payload scanning | unplug.api.encoding |
unplug.core.normalize.encodings |
| Span model runtime | unplug.api.ml |
unplug.ml.span_model |
| Rebuild scan result | unplug.api.results |
unplug.guard_scan / internal policy |
| Input/tool limits | unplug.api.limits or top-level LimitConfig |
unplug.config.limits, unplug.core.limits |
| BYOLLM judge | unplug.api.judge or top-level CallableJudge |
unplug.core.judge |
Server-side scan result enrichment:
from unplug.api.policy import policy_from_request
from unplug.api.privacy import PrivacyFilterService
from unplug.api.results import refresh_scan_result
from unplug.api.types import ScanRequest, ScanResultShared scan cache:
from unplug.api.cache import ScanCache, SafePrefixState, merge_suffix_resultMCP untrusted-content wrapping:
from unplug.api.boundaries import sanitize_boundary_markers, wrap_external_contentHosted semantic layer / local model runtime:
from unplug.api.ml import SpanInferenceModel
from unplug.api.normalization import Normalizer
from unplug.api.encoding import HeuristicEncodingClassifierLimits and optional LLM judge:
from unplug import CallableJudge, Guard, LimitConfig
# or: from unplug.api.limits import LimitConfig
# or: from unplug.api.judge import CallableJudge, JudgeProviderSee LIMITS_AND_JUDGE.md.
The older paths still work for now, but new code should not import from them:
unplug.modelsremains a compatibility re-export for wire types.unplug.core.cacheremains a deprecated compatibility path.unplug.core.*modules are private and may change in minor releases.
Downstream repos should add import-surface tests that import only from
unplug.api.*.
Runnable demo:
cd sdk
python examples/public_api_surface_demo.py