跳到正文
DEV Community· agent-tessera·· 7 小時前AI 評分56

Agent Tessera 開源 AI 智能體權限層的功能與限制

I built an open source permissions layer for AI agents. Here is what it does and what it can't do.

AI 導讀

作者建立開源 Agent Tessera,讓 AI 智能體以 YAML 政策管控經 SDK 接入的工具呼叫,未獲允許的操作會在執行前被拒絕並寫入審計記錄。審計事件包含前一事件的雜湊,可用來檢查記錄是否遭修改;SDK 在本機執行政策,可選伺服器則可登記智能體、簽署政策套件及收集審計事件。

正文

AI agents call tools: they read files, send email, hit internal APIs, run
code. In most codebases, what an agent is allowed to do is whatever its API
keys allow, and the record of what it did is scattered application logs.

Security teams are starting to ask the obvious questions. Which agents
exist? What can each one call? Who approved the risky action? Can you prove
what happened? Right now most teams can't answer.

I built Agent Tessera to answer them without tying you to one LLM provider or
agent framework. It is open source (Apache 2.0).

A policy allows files.read only; the agent's shell.run call is blocked, and the audit log verifies

What it looks like

You write what an agent may do in a short YAML file:

apiVersion: tessera/v1
kind: AgentPolicy
metadata:
  agent: demo
spec:
  tools:
    allow: ["files.read"]

You mark your tools, or wrap your LLM client:

@tessera.tool("shell.run")
def run_shell(command: str) -> str: ...

Anything the policy doesn't allow is denied before the function runs, and
the decision lands in an audit log. Each event includes the hash of the
previous one, so editing the log afterwards is detectable:

$ tessera audit verify .tessera/audit.jsonl
OK: 5 events
$ # change one event...
$ tessera audit verify .tessera/audit.jsonl
FAILED at line 4: hash mismatch

Design choices

Enforce locally, govern centrally. The SDK evaluates the policy inside
your process. There's no network call per decision, so it is fast and keeps
working if the control plane is down. The optional server registers agents,
issues short-lived credentials, signs policy bundles (the SDK rejects bundles
with a bad signature), collects audit events, and has a kill switch and a
web console.

Default deny, one decision order. Suspension and kill switches come first,
then explicit denies, delegation limits, the allow-rule check (no matching rule
means deny), rate limits and quotas, and approvals last. There's one order,
documented, and table-tested.

Plain YAML policies. I deliberately did not adopt a general policy
language. The people who review agent permissions are often not the people who
write the agent, and a short YAML file is something they can actually read.

Provider neutral. Adapters for OpenAI (and Azure), Anthropic, Bedrock,
Gemini, and LiteLLM; integrations for LangChain/LangGraph, MCP, the OpenAI
Agents SDK, and CrewAI. A registry lets you add your own client.

Minimal dependencies. The core needs httpx, pydantic, pyjwt, and
pyyaml. Provider SDKs are optional extras.

What it can't do

This matters more than the feature list.

It enforces policy inside the agent's process, on the calls you route through
it. If code calls a provider's HTTP API directly, nothing checks that call.
There is an opt-in detect_bypass mode that records such calls for the main
providers, but it only detects them. And a hostile process can disable the SDK
outright. It's a guardrail for agents you trust to be mostly well-behaved, not a
sandbox. For untrusted code, pair it with container isolation and egress rules.

It also doesn't track data between agents (agent A can pass B something B
couldn't read), and it doesn't detect prompt injection; it limits what an
injected agent can do through governed calls.

The full list is on the threat model page.

Where it's headed

A stable 1.0 API, agent-to-agent identity with A2A Agent Cards, and sub-agent
spawning with permission attenuation. Later: a gateway mode for agents you
can't modify, and a TypeScript SDK. SAML, SCIM, Slack/Teams approvals, and SIEM
connectors aren't built; contributions are welcome.

Try it

pip install agent-tessera

The README quickstart
takes about two minutes and needs no API key. I'd like to hear what is missing,
especially from people who have to answer "what can this agent do?" for a
security review.

Repo: https://github.com/agent-tessera/agent-tessera
Docs: https://agent-tessera.dev/

來源:DEV Community · dev.to