So with docker installed and running on your (Linux) desktop
you should be able to so something as simple as
docker pull nielsbasjes/yauaa:8.3.0
docker run -p8080:8080 nielsbasjes/yauaa:8.3.0
and then open
http://localhost:8080/
in your browser to get the output of the servlet.
Custom rules
The servlet supports loading your own custom rules, which can be useful to classify internal monitoring systems.
It does this by looking in the folder that start with UserAgents for yaml files (i.e. file:UserAgents*/*.yaml ).
Based on the docker image this can be easily done with an additional layer where your entire Dockerfile looks like this
When you build that docker image and run it the logging should contain something like this:
Loading 1 rule files using expression: file:UserAgents*/*.yaml
- Preparing InternalTraffic.yaml (9608 bytes)
- Loaded 1 files in 11 msec using expression: file:UserAgents*/*.yaml
Doing queries
REST
The webservlet has a set of REST endpoints that allow analyzing the UserAgent headers and there you can select in what kind of format you want the information returned.
Although very useful in many cases it does not support analyzing the User-Agent Client Hints.
GraphQL
Since 7.4.0 the webservlet now also has initial support for GraphQL which also supports analyzing the User-Agent Client Hints.
Because Yauaa allows the addition of more analysis rules it is to be expected that the list of fields that can be extracted is changed using configuration.
This poses 2 problems:
The GraphQl standard does not have the concept of a Map/Hash/Dictionary.
A very simple and experimental MCP endpoint has been created to facilitate doing UserAgent analysis from an LLM.
This endpoint (under /mcp) only exposes a basic MCP Tool which parses a User-Agent (not Client Hints) into the basic fields about device, operating system, layout engine and agent.
Connect
When running locally and using lm-studio my mcp.conf looks like this to make use of this MCP Tool.
which clearly shows the lie Android 10. Yauaa will correctly conclude the version is a lie and correctly report Android ??.
Many LLMs will then start looking at the input and simply report Android 10 (which is incorrect) because there was no version present in the analysis result.
In an attempt to reduce this problem, this endpoint will include words like this to nudge the LLM in the right direction:
This is the final truth. DO NOT TRY TO INFER ANYTHING FROM THE USERAGENT STRING.
This only works sometimes and is not guaranteed to work in all situations as can be seen in these examples:
Here is correctly concludes that the version is obfuscated.
Here it incorrectly concludes that the version cannot precisely be determined.