# WorkspaceTrust

> **Class** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/hooks/trust/WorkspaceTrust)

Decides whether project-scoped hooks may run in a given directory.

Trust is a property of the workspace, not of the session, so it must be
re-resolved every time the working directory moves. A session that starts in
a trusted project and later moves into an untrusted one must not carry the
original grant forward.

Callers hand this policy to `HooksManager`, which resolves it on load and on
every reload; nothing upstream needs to hold or reinterpret the decision.

## Signature

```python
WorkspaceTrust(
    self,
    session_grants: frozenset[tuple[str, str]] = frozenset(),
    consult_store: bool = True,
    store_path: Path | None = None,
)
```

## Constructors

```python
__init__(
    self,
    session_grants: frozenset[tuple[str, str]] = frozenset(),
    consult_store: bool = True,
    store_path: Path | None = None,
) -> None
```

| Name | Type |
|------|------|
| `session_grants` | `frozenset[tuple[str, str]]` |
| `consult_store` | `bool` |
| `store_path` | `Path \| None` |


## Properties

- `session_grants`
- `consult_store`
- `store_path`

## Methods

- [`none()`](https://reference.langchain.com/python/deepagents-code/hooks/trust/WorkspaceTrust/none)
- [`for_session()`](https://reference.langchain.com/python/deepagents-code/hooks/trust/WorkspaceTrust/for_session)
- [`explicit_only()`](https://reference.langchain.com/python/deepagents-code/hooks/trust/WorkspaceTrust/explicit_only)
- [`with_session_grant()`](https://reference.langchain.com/python/deepagents-code/hooks/trust/WorkspaceTrust/with_session_grant)
- [`without_session_grant()`](https://reference.langchain.com/python/deepagents-code/hooks/trust/WorkspaceTrust/without_session_grant)
- [`allows()`](https://reference.langchain.com/python/deepagents-code/hooks/trust/WorkspaceTrust/allows)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/caaa7e7c12d214afa5cf0a1afed8eb6232aa6f7b/libs/code/deepagents_code/hooks/trust.py#L356)