Skip to main content

Crate typesec

Crate typesec 

Source
Expand description

§typesec

Type-level security capabilities for Rust agents.

This facade crate re-exports the core capability model by default and exposes the policy engines, agent API, and macros behind feature flags.

Modules§

agent
Agent executor API.
capability
Capability — the unforgeable proof token
combinator
Policy Combinator
lattice
Capability Lattice
macros
Procedural macros.
odrl
ODRL policy engine.
permissions
Permission marker traits
policy
Policy engine trait and audit trail types.
rbac
RBAC policy engine.
resource
Resource trait — the thing a capability grants access to.
role
Role abstraction — a named collection of permissions.
secure_value
Opaque labeled values for information-flow style data handling.
typestate
Agent typestate

Structs§

Agent
An agent with a typestate parameter S and an attached policy engine.
AgentBuilder
Builder for SecureAgent — convenient when wiring multiple engines together.
AiCanExfiltrate
Permission for an AI agent to exfiltrate (export/transmit) data.
AiCanInfer
Permission for an AI agent to run inference over a resource.
AiCanTrain
Permission for an AI agent to use a resource as training data.
AuditEvent
A structured record of every policy decision.
Authenticated
Authenticated state. Policy checks and capability requests become available.
CanDeclassify
Permission to intentionally lower the security label of protected data.
CanDelegate
Permission to delegate capabilities to other agents.
CanDelete
Permission to delete a resource.
CanExecute
Permission to execute code or invoke actions on a resource.
CanRead
Permission to read a resource (non-sensitive).
CanReadSensitive
Permission to read sensitive resources (PII, credentials, etc.).
CanWrite
Permission to write (create or update) a resource.
CanWriteSensitive
Permission to write sensitive resources.
Capability
An unforgeable proof that subject subject holds permission P on resource R.
ComposedEngine
A multi-engine policy combinator with configurable strategy.
Credentials
Credentials used to authenticate an agent.
FallbackEngine
A two-engine fallback: tries primary first, then fallback on delegation.
Internal
Internal data: not public, but below sensitive and secret data.
LatticeEngine
Runtime lattice engine wrapper.
OdrlEngine
An ODRL policy engine.
PolicyEngineBuilder
Builder for ComposedEngine.
Public
Public data: safe to reveal without a capability.
RbacEngine
A compiled, fast-lookup RBAC engine.
Secret
Secret data such as credentials or highly restricted model inputs.
SecureAgent
A secure agent that ties together typestate, policy engines, and capabilities.
SecureValue
Data protected by a type-level privacy label and resource type.
Sensitive
Sensitive data such as PII or confidential business records.
Unauthenticated
The initial agent state. No policy operations are available yet.

Enums§

CombineStrategy
How to combine multiple policy engine verdicts into a single decision.
PolicyResult
The verdict returned by a policy engine.

Traits§

AgentState
Sealed state trait for the Agent typestate machine.
Implies
Trait encoding the permission lattice.
Join
Type-level least upper bound for two privacy labels.
Permission
A marker trait for permissions.
PolicyEngine
The core runtime policy interface.
PrivacyLevel
A type-level privacy label.
Resource
A resource that can be protected by a Capability.
Role
A role is a named collection of permissions.

Functions§

mint_capability
Mint a Capability by running a policy check.

Type Aliases§

TaskResult
The result type for task execution.