Django Admin

Admin configuration for the guardrail app.

Note

Experimental. The Guardrail was designed and coded by Claude Code (Anthropic’s Claude Opus 5.5), with Lawrence McDaniel as co-author. It is experimental, and will be documented.

class smarter.apps.guardrail.admin.GuardrailAdmin(model, admin_site)[source]

Bases: SmarterCustomerModelAdmin

Guardrail model admin.

This is a primary Smarter resource, that descends directly from MetaDataWithOwnershipModel. Visibility of Guardrails is determined by ownership and role. Guardrails are configured with manifests.

get_queryset(request)[source]

Visibility is determined by ownership and role.

list_display = ['name', 'user_profile', 'stage', 'category', 'strategy', 'action', 'mode', 'severity', 'priority', 'is_active', 'updated_at']
list_filter = ['stage', 'category', 'strategy', 'action', 'mode', 'is_active']
property media
model

alias of Guardrail

ordering = ['priority', 'name']
readonly_fields = ('created_at', 'updated_at')
search_fields = ['name', 'description']
class smarter.apps.guardrail.admin.GuardrailEventAdmin(model, admin_site)[source]

Bases: SmarterCustomerModelAdmin

GuardrailEvent model admin: the review queue of guardrails.

Events are read only, except reviewed. A user sees the events of the guardrails, and of the LLMClients, that they own.

actions = ['mark_reviewed']
get_queryset(request)[source]

Visibility is determined by ownership of the guardrail or the LLMClient, and role.

get_readonly_fields(request, obj=None)[source]

Hook for specifying custom readonly fields.

has_add_permission(request, obj=None)[source]

Override the default add permission logic to implement.

role-based access control for the admin console. Add permission is granted to superusers only.

list_display = ['created_at', 'guardrail_name', 'llmclient', 'stage', 'category', 'disposition', 'severity', 'confidence', 'reviewed']
list_filter = ['disposition', 'reviewed', 'stage', 'category', 'severity', 'mode']
mark_reviewed(request, queryset)[source]

Mark events as reviewed.

property media
model

alias of GuardrailEvent

ordering = ['-created_at']
search_fields = ['guardrail_name', 'session_key', 'rationale']