Skip to content
Learn Agentic AI11 min read0 views

Building an Agent Configuration UI: Admin Panels for Non-Technical Users

Design and build admin panels that let non-technical users configure AI agent behavior through intuitive forms, real-time preview, validation feedback, and approval workflows.

The Configuration Bottleneck

In most organizations, only engineers can modify agent behavior — even for simple changes like updating a greeting or adjusting response length. This creates a bottleneck where product managers, support leads, and operations staff submit tickets for trivial configuration changes. An admin panel removes this bottleneck by exposing safe, validated configuration options through a web interface.

The challenge is designing an interface that is powerful enough to be useful but constrained enough to prevent misconfiguration. You need validation, preview, and approval workflows to ensure quality.

Backend API Design

Start with a clean API that the admin panel consumes. Each endpoint enforces validation and tracks who changed what.

from fastapi import FastAPI, HTTPException, Depends
from pydantic import BaseModel, field_validator
from typing import Optional
from datetime import datetime
import uuid


app = FastAPI()


class AgentConfigUpdate(BaseModel):
    system_prompt: str
    greeting_message: str
    model: str = "gpt-4o"
    temperature: float = 0.7
    max_response_tokens: int = 1024
    enabled_tools: list[str] = []
    escalation_threshold: float = 0.3

    @field_validator("system_prompt")
    @classmethod
    def validate_prompt(cls, v: str) -> str:
        if len(v) < 50:
            raise ValueError("System prompt must be at least 50 characters")
        if len(v) > 10000:
            raise ValueError("System prompt must not exceed 10,000 characters")
        return v

    @field_validator("temperature")
    @classmethod
    def validate_temp(cls, v: float) -> float:
        if not 0.0 <= v <= 1.5:
            raise ValueError("Temperature must be between 0.0 and 1.5")
        return v

    @field_validator("max_response_tokens")
    @classmethod
    def validate_tokens(cls, v: int) -> int:
        if not 100 <= v <= 4096:
            raise ValueError("Max tokens must be between 100 and 4096")
        return v


class ConfigChangeRequest(BaseModel):
    id: str
    agent_id: str
    config: AgentConfigUpdate
    requested_by: str
    requested_at: datetime
    status: str  # pending, approved, rejected, applied
    reviewed_by: Optional[str] = None
    reviewed_at: Optional[datetime] = None
    review_note: Optional[str] = None

Form Schema Endpoint

Rather than hardcoding form fields in the frontend, serve a schema that describes what fields exist, their types, constraints, and help text. This lets you add new configuration options without redeploying the frontend.

@app.get("/api/agents/{agent_id}/config/schema")
def get_config_schema(agent_id: str):
    return {
        "fields": [
            {
                "name": "system_prompt",
                "type": "textarea",
                "label": "System Prompt",
                "help": "The core instructions that define agent behavior.",
                "min_length": 50,
                "max_length": 10000,
                "required": True,
            },
            {
                "name": "greeting_message",
                "type": "text",
                "label": "Greeting Message",
                "help": "The first message users see when starting a conversation.",
                "max_length": 500,
                "required": True,
            },
            {
                "name": "model",
                "type": "select",
                "label": "AI Model",
                "options": [
                    {"value": "gpt-4o", "label": "GPT-4o (Best quality)"},
                    {"value": "gpt-4o-mini", "label": "GPT-4o Mini (Faster, cheaper)"},
                ],
                "required": True,
            },
            {
                "name": "temperature",
                "type": "slider",
                "label": "Creativity Level",
                "help": "Higher values make responses more varied. Lower values are more focused.",
                "min": 0.0,
                "max": 1.5,
                "step": 0.1,
                "required": True,
            },
            {
                "name": "enabled_tools",
                "type": "checkbox_group",
                "label": "Enabled Capabilities",
                "options": [
                    {"value": "search", "label": "Web Search"},
                    {"value": "calculator", "label": "Calculator"},
                    {"value": "file_reader", "label": "File Reading"},
                ],
            },
        ]
    }

Preview Endpoint

Before applying changes, let users see how the agent would respond with the new configuration. This is the most important safety feature in the admin panel.

See AI Voice Agents Handle Real Calls

Book a free demo or calculate how much you can save with AI voice automation.

class PreviewRequest(BaseModel):
    config: AgentConfigUpdate
    test_message: str = "Hello, I need help with my account."


class PreviewResponse(BaseModel):
    response: str
    model_used: str
    tokens_used: int
    latency_ms: float


@app.post("/api/agents/{agent_id}/config/preview")
async def preview_config(agent_id: str, req: PreviewRequest) -> PreviewResponse:
    import time
    from openai import AsyncOpenAI

    client = AsyncOpenAI()
    start = time.time()

    completion = await client.chat.completions.create(
        model=req.config.model,
        temperature=req.config.temperature,
        max_tokens=req.config.max_response_tokens,
        messages=[
            {"role": "system", "content": req.config.system_prompt},
            {"role": "user", "content": req.test_message},
        ],
    )

    latency = (time.time() - start) * 1000
    return PreviewResponse(
        response=completion.choices[0].message.content or "",
        model_used=req.config.model,
        tokens_used=completion.usage.total_tokens if completion.usage else 0,
        latency_ms=round(latency, 1),
    )

Approval Workflow

For production agents, changes should not go live immediately. An approval workflow ensures a second pair of eyes reviews configuration changes before they affect real users.

change_requests: dict[str, ConfigChangeRequest] = {}


@app.post("/api/agents/{agent_id}/config/request")
async def request_change(agent_id: str, config: AgentConfigUpdate, user: str = "admin"):
    request_id = str(uuid.uuid4())
    change_requests[request_id] = ConfigChangeRequest(
        id=request_id,
        agent_id=agent_id,
        config=config,
        requested_by=user,
        requested_at=datetime.utcnow(),
        status="pending",
    )
    return {"request_id": request_id, "status": "pending"}


@app.post("/api/config-requests/{request_id}/approve")
async def approve_change(request_id: str, reviewer: str = "lead"):
    req = change_requests.get(request_id)
    if not req:
        raise HTTPException(404, "Change request not found")
    if req.status != "pending":
        raise HTTPException(400, f"Request is already {req.status}")

    req.status = "approved"
    req.reviewed_by = reviewer
    req.reviewed_at = datetime.utcnow()

    # Apply the configuration
    apply_config(req.agent_id, req.config)
    req.status = "applied"

    return {"status": "applied", "reviewed_by": reviewer}


def apply_config(agent_id: str, config: AgentConfigUpdate):
    # Write to your config store (Redis, DB, etc.)
    print(f"Applied config for {agent_id}: model={config.model}")

Version Diff Display

Show administrators exactly what changed between the current and proposed configuration, similar to a code diff.

def compute_config_diff(
    current: dict, proposed: dict
) -> list[dict]:
    diffs = []
    all_keys = set(current.keys()) | set(proposed.keys())
    for key in sorted(all_keys):
        old_val = current.get(key)
        new_val = proposed.get(key)
        if old_val != new_val:
            diffs.append({
                "field": key,
                "old_value": old_val,
                "new_value": new_val,
                "change_type": (
                    "added" if old_val is None
                    else "removed" if new_val is None
                    else "modified"
                ),
            })
    return diffs

FAQ

Should the admin panel allow direct prompt editing or use templates?

For most teams, start with templates that have fill-in-the-blank sections. Direct prompt editing gives maximum flexibility but also maximum risk. A hybrid approach works well: offer templates for common patterns with an "advanced mode" toggle that shows the raw prompt for experienced users.

How do I prevent the admin panel from becoming a security risk?

Every API endpoint behind the admin panel must enforce authentication and authorization. Use role-based access control so only designated users can modify production agent configurations. Log every action with the user's identity. Never expose the admin panel without TLS.

What if a configuration change breaks the agent?

The preview endpoint is your first line of defense — users can test changes before applying them. The approval workflow is the second. If a bad config still gets through, maintain a version history so you can instantly revert to the last known good configuration.


#AdminPanel #AIAgents #ConfigurationUI #UserInterface #Python #AgenticAI #LearnAI #AIEngineering

Share this article
C

CallSphere Team

Expert insights on AI voice agents and customer communication automation.

Try CallSphere AI Voice Agents

See how AI voice agents work for your industry. Live demo available -- no signup required.