App rules
Every app built on the Personaas API must follow these rules, whether a person or a coding agent writes it. The checklist at the end sums them up.
Security
- Each person signs in as themselves, or enters their own personal API key. Never build a key into the app itself. See Authentication.
- Keep tokens and keys in the platform's secure storage for secrets and send them only to Personaas.
- Do not log tokens, keys or full message contents.
Behaviour
- One user action = at most one run. No runs on page load, no polling by running.
- Show a waiting state as soon as a run starts; runs can take minutes.
- Give the user a way to stop a long run (
/kill, on the organisation's engine). - Show errors in plain words using the
detailfield. Never show a blank screen. - Handle "no personas assigned" with a clear message telling the user to ask their administrator.
- Tasks marked
sensitive: hide them. Apps cannot run them yet.
Content
- Render answers as Markdown, and sanitise the HTML you produce from it.
- Persona answers can be wrong. For anything that changes data or money, show the answer to the user and let them confirm; do not act on it automatically.
Portability
- The URL comes from configuration (
PERSONAAS_BASE_URL), never from the code. - Test with a test account and personas set up for testing. Every run uses real allowance and can change real data.
- Look personas and tasks up by listing them, then match by name or let the user choose. Ids are not the same across organisations.
Checklist before the app is done
- Each person uses their own personal API key, or signs in; no key is built into the app.
- Every Personaas call is in the API reference.
- Empty state handled: the user has no personas assigned.
- Slow and failed runs handled: waiting state,
503, failed or stopped runs, errordetailshown in plain words. - Tasks marked
sensitiveare hidden. - No persona id, task id, host name or key is hard-coded.