Enterprise Prompt Governance, Token Budgets, and Rate Limits
Managing system prompts, enforcing institutional brand voice, configuring monthly token quotas, and securing model inputs.
1. Overview & Business Value#
Operationalizing 47 autonomous agents across enterprise departments requires strict prompt governance, per-department token budget limits, and audit enforcement.
1. Overview & Institutional Governance#
The SmartERP Prompt Registry (addons/muk_ai/models/prompt.py) stores version-controlled system instructions. System prompts cannot be edited by standard end-users. All modifications require approval from a designated AI Governance Administrator.
{screenshot:ai-governance-prompt-registry}
2. Prerequisites & Security Groups#
- Required Modules:
muk_ai, smarterp_security - Security Group:
Ashewa AI / Manager(Technical ID:muk_ai.group_ai_manager) - Dependencies: Active provider configurations and department cost centers.
3. Step-by-Step Configuration & Execution#
Step 1: Navigating to Prompt Management#
- Open Settings → Technical → Ashewa AI → System Prompts.
- Select the target agent (e.g.,
Financial Audit Agent).
Step 2: Parameterizing Token Budgets & Rate Limits#
- Specify the Maximum Context Tokens (e.g.,
8192). - Set the Department Monthly Token Quota (e.g.,
5,000,000 tokens). - Set the Hard Stop Action: Choose between
Block ExecutionorFallback to Flash Lite. - Define temperature parameters:
- For financial and legal agents:
temperature: 0.1(deterministic). - For creative marketing copywriters:
temperature: 0.7(expressive).
- For financial and legal agents:
{screenshot:ai-governance-token-budget}
Step 3: Enforcing PII Redaction Rules#
Enable the Automatic PII Redactor switch to mask tax identification numbers (TIN), bank account numbers, and personal salary figures before transmitting prompts to external model endpoints.
4. Advanced Configuration Points#
- Automated Tasks (Crons):
Ashewa AI: Reset Monthly Department Quotas(muk_ai.ir_cron_reset_quotas, 1st of each month).Ashewa AI: Audit Prompt Drift(muk_ai.ir_cron_audit_prompts, weekly).
- Multi-Company Partitioning: Quotas are strictly partitioned by Company ID (
res.company).
5. Comprehensive Troubleshooting Matrix#
| Error Symptom | Root Cause | Corrective Action |
|---|---|---|
TokenQuotaExceededError: Monthly budget exhausted | Department has exceeded assigned token allocation. | Increase monthly quota in Settings → AI Budgets or wait for automated monthly reset. |
PromptInjectionDetected: Prohibited keyword pattern | User input triggered prompt-injection safeguard rules. | Inspect prompt attempt in ashewa.ai.log and educate user on input compliance. |
ModelAuthenticationError: 401 Unauthorized | Invalid or revoked API key in provider pool. | Rotate expired key in Settings → AI Providers → Credentials. |
2. Prerequisites & Security Access Groups#
- Required Modules:
muk_ai, muk_mcp, smarterp_ai_suite - Security Group:
Ashewa AI / User(Technical ID:muk_ai.group_ai_user) - Master Data Dependencies: Configured AI provider credentials, active system prompts, and departmental cost centers.
3. Step-by-Step UI Execution & Verification#
Step 1: Navigating to the Operational Interface#
- Log into your SmartERP instance at
https://smarterp.et/odoo. - Open the main App Switcher and select Ashewa AI.
- Select the operational workspace corresponding to this agent suite.
{screenshot:40-agent-governance-and-architecture-step1-navigation}
Step 2: Executing Agent Actions#
- Review agent prompts and execution parameters.
- Trigger the scheduled or on-demand workflow action.
- Validate output in the generated operational log.
{screenshot:40-agent-governance-and-architecture-step2-execution}
4. Advanced Configuration Points#
- Scheduled Crons:
muk_ai.ir_cron_agent_health_checkruns every 30 minutes. - Multi-Company Isolation: Multi-company record rules ensure agent context is isolated to Company 1 (
Ashewa Technology Solutions S.C.).
5. Comprehensive Troubleshooting Matrix#
| Symptom / Error | Probable Root Cause | Resolution Action |
|---|---|---|
Agent unresponsive or timeout | Network latency or API endpoint outage. | Verify provider connection in Settings → AI Providers. |
Access Denied during agent execution | User lacks assigned operational permissions. | Assign user to the designated operational group. |