TramAI logo

Governed AI Workflows for Java and Kotlin.

Runtime policy, human approval, controlled model and tool access, sovereignty controls, and reviewable execution evidence — inside your JVM stack.

What "governed" means in practice

TramAI enforces the execution boundary around your AI workloads — not just the model call:

Enforce runtime policy — allow/deny decisions at provider and tool boundaries.
Restrict models and providers — explicit allowlists and trust zones.
Control tool execution — ALLOW, DENY, or REQUIRE_APPROVAL per tool.
Require human approval — suspend/resume lifecycle for sensitive actions.
Keep sensitive workloads in trusted zones — data-classification-aware routing.
Retain reviewable execution evidence — hash-chained audit and evidence packs.

Governed AI, by Design

Building the agent is one problem. Governing it in production is another. TramAI focuses on the governance boundary.

Kotlin
@AiService
interface ReviewAnalyzer {
    @Operation("Analyze the sentiment of this review and extract key topics.")
    suspend fun analyze(text: String): Analysis
}

data class Analysis(
    val sentiment: Sentiment,
    val topics: List<String>,
    val requiresFollowup: Boolean
)
Java
@AiService
public interface ReviewAnalyzer {
    @Operation(
        prompt = "Analyze the sentiment of this review and extract key topics."
    )
    Analysis analyze(String text);
}

public record Analysis(
    Sentiment sentiment,
    List<String> topics,
    boolean requiresFollowup
) {}

Define your contract, Tramai handles the rest: prompt construction, governed model routing, and type-safe parsing.

Choose Your Path

Tramai is modular. Start where you are and grow as needed.

28

Modules

10+

Providers

25+

Guides

Java 21+

JVM Ready

Providers: OpenAI, Anthropic, Gemini, DeepSeek, Ollama, Bedrock, Azure OpenAI, and more

AI as a 4th Software Layer

TramAI adds @AiService as a first-class architectural layer alongside your controllers, services, and repositories. Same rigor. Same injection model. Same testability.

@Controller@Service@AiService@Repository

Governance-First, Not Just Another Framework

LangChain4j and Spring AI build and orchestrate AI workloads. TramAI governs the execution boundaries around them. No marketing — just what each product does.

CapabilityTramaiLangChain4jSpring AI
Model integration CoreCoreCore
Typed structured output Automatic JSON schema from data classes, parse-and-retryManual schema definitionStructuredOutputConverter
Runtime policy enforcement Allow/deny decisions at provider and tool boundaries (6 enforcement points)Not a primary design focusNot a primary design focus
Classification-aware routing Data classification constrains provider zones (RESTRICTED → LOCAL only)External integration requiredExternal integration required
Provider trust zones LOCAL / EU_CLOUD / GLOBAL_CLOUD zones enforced at runtimeVaries by implementationVaries by implementation
Tool permission policies ALLOW / DENY / REQUIRE_APPROVAL at exposure and executionVaries by implementationVaries by implementation
Human approval lifecycle Suspend/resume with cryptographically bound approval tokensExternal integration requiredExternal integration required
Governed fallback Policy hook before provider fallback; fallback providers allowlistedVaries by implementationVaries by implementation
Auditability SHA-256 hash-chained audit events for every policy decisionExternal loggingExternal logging
Execution evidence Runtime evidence exporters (policy.decision, tool.permission) and evidence packsExternal loggingExternal logging
Sovereign / local execution Offline deployment mode, local-only routing, zero-egress optionsVaries by implementationVaries by implementation
Control plane (inventory, intervention, explainability) Roadmap — TramAI 0.7.0 direction

"Varies by implementation" and "external integration required" mean the capability is not a first-class part of the framework and depends on the surrounding system. The control-plane row is explicitly marked as TramAI roadmap direction, not shipped functionality.

Other frameworks can build and orchestrate AI workloads. TramAI specializes in governing their execution boundaries. See the AI agent governance pillar for the full reasoning.