excluded_middleware: frozenset[type[AgentMiddleware] | str] = frozenset()Middleware to strip from every stack this profile applies to.
Entries may be a middleware class (matched by exact type, not subclass —
consistent with extra_middleware slot merging) or a string matching
AgentMiddleware.name exactly. .name defaults to the class's
__name__ but is overridable, so {TodoListMiddleware} (class form) and
{"TodoListMiddleware"} (name form) behave identically for stock
middleware.
Prefer class form when the class is importable: typos surface at import
time rather than at agent construction. Reserve string form for
YAML/JSON-loaded profiles and for middleware whose class isn't part of
the public import surface (e.g. "SummarizationMiddleware" drops the
private _DeepAgentsSummarizationMiddleware via its public alias).
The filter runs over the fully assembled stack, so exclusions remove
middleware regardless of which layer added it — including instances
passed via create_deep_agent(middleware=[...]). Merged profiles union
their exclusion sets; mixed class/string sets are allowed. For config-file
usage, HarnessProfileConfig stores the same exclusions using string names
only.
Middleware whose concrete class name differs from the public alias
users would type (e.g. _DeepAgentsSummarizationMiddleware vs.
"SummarizationMiddleware") can expose a serialized_name: ClassVar[str]
for stable config-file round-trips. .name on the instance returns
the alias so string-form exclusion matches, and
HarnessProfileConfig.from_harness_profile serializes the class back
to that alias.
ValueError immediately.
Class-path (module:Class) entries are not currently supported
and may be added in a future revision; pass the class itself
through the runtime HarnessProfile instead.FilesystemMiddleware, SubAgentMiddleware,
_PermissionMiddleware) cannot be excluded as class or as their
.name string. The check fires at HarnessProfile construction,
so register-site typos fail fast rather than waiting until
create_deep_agent resolves the profile.