Good API security starts with strong authentication and object-level authorisation, so every request is checked for who is calling and what they may access. Add rate limits, validate all input, keep secrets out of code, encrypt traffic, log and monitor usage, and keep an inventory of every API. In the AI era, also give agents scoped, per-user credentials, require approval for sensitive actions and treat content an agent reads as untrusted, because prompt injection can turn an agent against your systems.
- ✓Broken object-level authorisation is the top API risk in the OWASP API Top 10
- ✓Authenticate every request and check access to each object
- ✓Rate-limit, validate input and keep secrets out of code
- ✓Give AI agents scoped, per-user credentials and approvals
- ✓Log and monitor API and agent activity
Why does API security matter more now?
APIs carry most of the data that moves between apps, partners and mobile clients, so they are a prime target. The OWASP API Security Top 10 lists the most common weaknesses, led by broken object-level authorisation: an API that checks who you are but not whether you may see the specific record you asked for. AI adds a new kind of caller: agents that make many requests on behalf of users and can be misled by instructions hidden in content they read. Our plain-English guide to what an API is covers the basics.
What are the most common API risks?
What are the core best practices?
-
1
Authenticate every requestUse standard methods such as OAuth 2.0 and short-lived tokens.
-
2
Authorise every objectCheck the caller may access each specific record and action.
-
3
Validate inputReject unexpected types, sizes and values.
-
4
Return only what is neededFilter response fields on the server.
-
5
Rate-limit and throttleLimit requests per user, key and IP.
-
6
Protect secretsStore keys in a secrets manager, never in code or front-end apps.
-
7
Encrypt trafficUse HTTPS everywhere.
-
8
Log and monitorRecord access and alert on unusual patterns.
-
9
Keep an inventoryKnow every API and version, and retire old ones.
What changes when AI agents call your APIs?
- Follows code written by your developers
- Predictable request patterns
- Actions chosen by the user in the interface
- ✓Decides which calls to make at run time
- ✓Can make many calls quickly
- ✓May follow instructions hidden in emails, pages or files
- Give agents per-user, scoped credentials rather than shared admin keys
- Expose a small set of task-shaped actions, ideally through a reviewed MCP server
- Require human approval for actions that change, delete, send or pay
- Treat any content an agent reads as untrusted input
- Set limits on calls, spend and time per agent task
- Log agent requests separately so they can be audited
MCP-specific risks such as tool poisoning are covered in MCP security risks, and approval design in human-in-the-loop AI.
What about webhooks and integrations?
Webhooks need their own protection: verify signatures on every incoming event, accept them only over HTTPS and make processing safe if the same event arrives twice. Third-party integrations should use the minimum permissions they need, and their keys should be rotated regularly. See webhooks vs APIs.
What does a real incident look like?
An online learning platform lets users download certificates from /api/certificates/{id}. The API checks that the user is logged in but not that the certificate belongs to them. A user changes the ID in the address and downloads other people’s certificates, which include names and email addresses. The fix is an object-level check on every request: does this certificate belong to the signed-in user? The same flaw becomes more dangerous with AI agents, which can try many IDs in seconds if a prompt or injected instruction tells them to. Object-level checks, rate limits and logging would each have limited the damage.
How should you test API security?
- Include authorisation tests in automated test suites for every endpoint
- Run regular security scans and periodic penetration tests
- Test with an AI agent connected to the API, including attempts at prompt injection
- Review logs for unusual access patterns after each release
Where should you start?
Security is never finished. Review your API inventory and access rules every quarter, and whenever you connect a new AI tool or partner.
Assign an owner for each API so security fixes do not stall between teams.
Small, consistent checks prevent most serious incidents.
Train developers on the OWASP API Top 10 so these checks become habit.
AI features add new risks such as prompt injection; see our guide to AI security.
How UIUX Studio helps
We design and review APIs and AI integrations with security built in, from authorisation models to agent access and monitoring. Talk to our product engineering and technology advisory teams.
