AWS Builder Center

Agents for Humans: giving AgentCore a door and a clock

InvokeAgentRuntime accepts no browser, OAC on a Function URL breaks a plain fetch, and my README claimed something the product did not do.

Two problems nearly sank Instanter and neither one was the agent.
Nobody could reach it. And it never ran unless somebody told it to.
Both are worth writing up. Both are easy to miss until late, and the second one had been sitting in my own README for weeks.

InvokeAgentRuntime does not accept a browser

Amazon Bedrock AgentCore Runtime is a good place to put an agent. I got a 900 second timeout, session isolation, and a plain HTTP contract to build against, and my human-in-the-loop interrupt survived a cross-process resume on it.
Then I read the invocation surface properly. InvokeAgentRuntime takes IAM SigV4 or an OAuth bearer token. That is the entire list. A browser has neither.
For a hackathon that is close to fatal. A judge with five minutes is not going to configure credentials, and the strongest predictor I have found for these events is a live URL plus one measured number a stranger can check without an account. An agent nobody can invoke has neither of those.
So I put a Lambda in front of it. The Lambda holds the credential and calls the runtime server side, and one CloudFront distribution serves the console and the API from the same origin. The default behaviour goes to a private S3 bucket with Origin Access Control. Everything under /api/* goes to a Lambda Function URL.

Why the Function URL is public, which looks wrong

The obvious move is Origin Access Control on the Function URL so only CloudFront can call it. I tried that first. It does not work for this shape and the reason is worth knowing before you burn an evening on it.
OAC on a Lambda Function URL forces AWS_IAM auth. Once auth is IAM, a POST has to send x-amz-content-sha256, and a plain browser fetch will not send it. The console's own POST breaks.
The documented alternative is a shared secret header that CloudFront injects and the function requires. So the Function URL is AuthType NONE, CloudFront adds x-instanter-origin, and the handler refuses anything that arrives without it. Find the Function URL directly and you get a 403. I verify that from outside on every check, because a guard nobody tests is a comment.
Two smaller things came out of this that I would do again.
The free endpoint and the paid endpoint need different rules. The stats endpoint recomputes all 46 deadlines with the same engine the test suite covers and costs nothing, so it is uncapped and served no-store. Caching it would turn a recomputation into a stored number, which is exactly the thing it exists to disprove. The run endpoint invokes a model, so it carries a daily counter built on a DynamoDB atomic ADD, because two simultaneous clicks must not both read the same value and both decide they were under the cap.
And a cap I could not use. I had planned reserved concurrency as the abuse control. This account's total Lambda concurrency limit is 10, not the 1000 I assumed, and reserving any of it drops unreserved concurrency below the required minimum and fails the deploy outright. The account ceiling was already the cap. Check that limit before you design around it.

The contradiction in my own README

This is the one that bothers me, because it was in plain sight.
The README says, second paragraph: a walk-in clinic cannot watch every clock.
That is the premise. It is why the thing exists. And until this week the agent only ran when somebody pressed a button on a web page, which is precisely the thing the pitch says nobody has time to do.
The product's central claim was the one thing it did not do.
I did not find that by reviewing code. I found it by grepping my own shipped source for which AWS services were actually wired, comparing that list to the plan I wrote at kickoff, and noticing EventBridge Scheduler was on the plan and in nothing else.
The sweep now fires at 7am on weekdays. Two details in there are deliberate.
It runs in America/New_York, not UTC. Deadlines get counted in the court's calendar and Fulton County State Court sits in Eastern time. A named timezone also follows daylight saving with no code change, which a UTC cron does not.
The scheduled run has its own budget, separate from the visitor cap. Those two defend against different things. The visitor cap stops a stranger draining model spend. The scheduled cap stops a misconfigured or retried schedule firing the sweep in a loop. Share one counter and a busy day of visitor traffic silently cancels the clinic's morning sweep, which is the one run that actually has to happen.
The scheduled sweep ends where a visitor's run ends. At the attorney interrupt, with nothing committed. An awaiting endpoint lists the runs that stopped and are still owed a decision, served through a sparse DynamoDB index on status rather than a scan with a filter. The daily counter rows carry no status attribute, so they never enter that index at all.

Prove it by firing it

I did not wait until 7am to find out whether any of this worked.
I read the input payload back off the deployed schedule, invoked the function with that exact payload, and watched it sweep 48 cases and stop on two. Then I loaded the public URL with no credentials and the console said so in plain language: two cases waiting on an attorney, from a sweep that ran with nobody watching.
That habit has caught more defects for me this month than any test suite. A green suite sitting next to dead wiring is the most convincing wrong answer a system can hand you, and the only cure is to make the thing happen and go look at it.

What I would tell someone starting this

Read the invocation surface of your agent host before you design the front end.
Grep your shipped source for the services you claim, not your design doc. The doc drifts. The code does not.
And read your own pitch like a judge wrote it, then check whether the product actually does that.
Mine did not. It does now.
Instanter drafts only and never files, computes deadlines and never advises, and keeps a licensed attorney in the loop for every case it surfaces. All demo data is synthetic. The statutes are real and public. Built solo for the Agents for Humans Hackathon.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article