resolve • AI Agent SDK

resolve: Resolve a path against the workspace root with security checks.

resolve

Method

</div>

This is a method of the Workspace class in the workspace module.

Resolve a path against the workspace root with security checks.

Signature

python
def resolve(path: str | Path) -> Path

Parameters

ParamField str \| Path

Relative or absolute path to resolve

Returns

ResponseField Path

Absolute path within workspace

Exceptions

ValueError

If path escapes workspace or contains traversal attempts

Uses

  • Path
  • has_traversal_component
  • ValueError
  • path.is_absolute
  • path.resolve
  • resolve
  • resolved.relative_to

Used By

Source

View on GitHub

praisonaiagents/workspace/__init__.py at line 68