Contract-based Web Design: From Protocols to Natural Language Contracts

Within the next decade, automated AI agents will mediate most web browsing. In such a paradigm, the owners of content will have little or no control over the user interface and experience. This shift requires rethinking how we structure web interactions so consumer-side agents can communicate effectively with their content owner-side counterparts. We propose moving from rigid protocols to natural language contracts that both humans and AI can understand and negotiate.

Key Concepts

Natural language contracts between AI agents require three fundamental properties:

Having a publicly available contract creates a focal point - a default solution both parties understand without detailed communication. Unlike traditional APIs embedded in interfaces, these contracts can be adapted through AI negotiation while maintaining security through established verification mechanisms.

The Evolution of Web Contracts

The web's development shows a clear progression toward more flexible interactions. Initially, protocols provided unambiguous but rigid rules for machine-to-machine communication. APIs followed, offering more flexibility while remaining machine-first. Now, natural language contracts represent the next step - agreements that humans can read and AI can execute.

This evolution trades unambiguity for flexibility, enabling richer interactions through controlled ambiguity. AI agents make this trade-off valuable by bridging human and machine understanding.

AI Agents as Contract Mediators

AI agents serve as ideal mediators because they communicate in natural language while understanding machine code. This dual capability enables:

For example, when a bank requests personal information, traditional smart contracts must specify exact cryptographic requirements. With AI mediation, the contract can remain implementation-agnostic while ensuring security through negotiation.

Verification and Security

While embracing natural language flexibility, these contracts maintain security through:

This framework preserves trust while allowing implementation details to emerge through AI negotiation.

Risks and Challenges

The shift to natural language contracts introduces several considerations:

Open Questions

As we move toward AI-mediated web interactions, several questions require exploration:

Conclusion

The transition from protocols to natural language contracts mediated by AI agents offers more flexible, human-readable web services while preserving machine executability. This evolution promises to reshape how we interact with web services. However, the inherent tension between natural language ambiguity and secure machine execution remains a fundamental challenge to overcome.


This article was published on 9th December 2024 with the help of Claude.


References

Barnett, J., & Treleaven, P. (2018). Algorithmic Dispute Resolution—The Automation of Professional Dispute Resolution Using AI and Blockchain Technologies. Computer Journal, 61, 399-408, doi.org/10.1093/comjnl/bxx103

Szabo, N. (1997). Formalizing and Securing Relationships on Public Networks. First Monday, 2(9), doi.org/10.5210/fm.v2i9.548

Wikipedia contributors. (2024). Focal point (game theory). In Wikipedia. Retrieved from https://en.m.wikipedia.org/wiki/Focal_point_(game_theory)