Terminal, plain-text, and custom renderers that control how Attesta presents challenges and results to operators
Renderers control how Attesta presents risk assessments, challenges, and results to human operators. Attesta ships with two built-in renderers and supports custom implementations through the Renderer protocol.
The TerminalRenderer uses the Rich library to create a polished, interactive terminal UI with colored panels, formatted tables, progress bars, and real-time prompts.
from attesta import Attestafrom attesta.renderers import TerminalRenderer# TerminalRenderer is the default when Rich is installedattesta = Attesta()# Explicit selectionattesta = Attesta(renderer=TerminalRenderer())# With custom theme colorsattesta = Attesta( renderer=TerminalRenderer( theme={ "low": "green", "medium": "yellow", "high": "orange1", "critical": "red", } ))
If the Rich library is not installed, Attesta automatically falls back to PlainRenderer. Install Rich with pip install attesta[terminal] or pip install attesta[all] to enable the terminal UI.
The PlainRenderer uses Python’s built-in print() and input() functions. No external dependencies are required. This renderer is ideal for environments where Rich is unavailable or where structured output is preferred over visual formatting.
--- HIGH RISK --- Quiz Required ---Action: deploy_serviceDescription: Deploy api-gateway v2.1.0 to stagingAgent: deploy-botRisk Score: 0.68 (HIGH)Arguments: service="api-gateway", version="2.1.0", env="staging"Q1: Which service will be deployed? a) auth-service b) api-gateway c) web-frontend d) data-pipelineYour answer (a/b/c/d):
Custom renderers are the primary extension point for integrating Attesta into non-terminal environments. Web dashboards, mobile apps, Slack/Teams bots, and email-based approvals can all be implemented as custom renderers.
Explicit — If you pass a renderer parameter, it is used
Rich available — If Rich is installed and stdout is a TTY, TerminalRenderer is used
Fallback — PlainRenderer is used in all other cases
# Priority 1: Explicit rendererattesta = Attesta(renderer=SlackRenderer(...))# Priority 2: Rich auto-detectionattesta = Attesta() # TerminalRenderer if Rich is installed + TTY# Priority 3: Fallback# Automatically used in CI/CD or when Rich is not installed