Deprecated: Creation of dynamic property Timber\Site::$pingback is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Site.php on line 180

Deprecated: Creation of dynamic property Timber\User::$name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/User.php on line 118

Deprecated: Creation of dynamic property Timber\Post::$has_disclaimer is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_lock is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_last is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_meta_box_present is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_send_notification is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_modify_title_and_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_heading is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_category is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_blz_affiliation_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_content_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_speciali is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskw is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_metadesc is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_linkdex is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_content_score is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskeywords is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_keywordsynonyms is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_estimated-reading-time-minutes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_thumbnail_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$response_body is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_indexnow_last_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_date_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ping_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_password is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$to_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$pinged is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_content_filtered is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$guid is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$menu_order is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_mime_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_count is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$filter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71
Cloudflare ha usato l'AI per scrivere una libreria OAuth: ecco cosa è andato storto (e cosa sorprende)

Cloudflare ha usato l'AI per scrivere una libreria OAuth: ecco cosa è andato storto (e cosa sorprende)

L’adozione dell’intelligenza artificiale generativa nello sviluppo software sta trasformando il modo in cui si costruiscono strumenti critici, come dimostra il caso della nuova libreria OAuth 2.1 per Cloudflare Workers. Sviluppata con il contributo predominante di Claude AI, questa libreria offre uno spunto di riflessione sul futuro del coding assistito.

Usare l’intelligenza artificiale generativa per le attività di sviluppo software è ormai all’ordine del giorno, da parte del professionista così come dei team di qualunque dimensione. La nuova libreria OAuth di Cloudflare, pubblicata su GitHub, rappresenta un caso di studio emblematico. Sviluppata in gran parte con l’assistenza di Claude, il Large Language Model (LLM) di Anthropic, questa libreria ha attirato l’attenzione per due motivi principali: da un lato, l’ambizione di un provider leader nella sicurezza Web di affidarsi all’AI per un componente così critico come l’autenticazione; dall’altro, la trasparenza nel commit log, che documenta interazioni, correzioni e rifiniture successive.

Ma quanto è solida questa libreria? È davvero sicuro affidarsi a un LLM per scrivere codice di tale portata? E dove si collocano i limiti tra automazione intelligente e supervisione umana?

OAuth 2.1 per Cloudflare Workers: come funziona il nuovo framework

Gestire in modo sicuro e standardizzato l’autenticazione degli utenti rappresenta una delle sfide centrali. Cloudflare Workers si è affermata come una piattaforma estremamente potente per implementare microservizi e API, in un mondo che guarda sempre più ad approcci distribuiti e serverless.

La libreria presentata da Cloudflare implementa il lato provider del protocollo OAuth 2.1: è appositamente progettata per funzionare all’interno dell’ambiente Cloudflare Workers, sfruttando pienamente i suoi modelli asincroni e la flessibilità nella gestione delle richieste HTTP.

La OAuth 2.1 Provider Framework for Cloudflare Workers si propone come un wrapper che semplifica l’implementazione della logica di autenticazione OAuth nelle API distribuite, gestendo in modo trasparente tutta la parte di token management, validazione e metadata discovery.

Al di là delle funzionalità della libreria, ciò che colpisce di questo progetto è il fatto che, per larga parte, il codice è stato realizzato avvalendosi di un modello generativo fornito da Claude AI.

L’AI utile per scrivere il codice di una libreria essenziale dal punto di vista della sicurezza

A guidare l’esperimento è stato Kenton Varda, ingegnere di punta di Cloudflare, inizialmente scettico sul reale valore degli LLM in contesti di sviluppo software. Il suo approccio, pragmatico e critico, si è presto trasformato in una testimonianza diretta dell’efficacia del metodo: Claude ha scritto oltre il 95% del codice, ma ciò che colpisce è come ogni commit Git contenga non solo le modifiche, ma anche i prompt che le hanno generate, costituendo un nuovo livello semantico nella cronologia dello sviluppo software.

Ciò che colpisce è la radicale trasparenza nel processo creativo: ogni prompt, ogni correzione, ogni scelta è tracciata nei messaggi dei commit, restituendo una cronaca viva e precisa di come un modello AI e un team umano possano co-costruire software in modo sinergico.

Il log Git smette di essere una cronologia di modifiche e diventa una sorta di “registro delle intenzioni“. Nel caso della libreria Cloudflare, lo sviluppo software è documentato nella sua dimensione cognitiva, tracciando in tempo reale l’evoluzione della logica, del contesto e della comprensione condivisa tra uomo e macchina.

I limiti: dove Claude ha fallito

Nonostante i risultati davvero notevoli, il progetto ha evidenziato i limiti attuali delle AI nel coding. Intorno al ventesimo commit, ad esempio, Varda è intervenuto per correggere manualmente una riorganizzazione fallita di classi.

In altri casi, Claude ha ripiegato sui comandi grep e sed per rimediare a una sostituzione non riuscita. E negli ultimi dieci commit, la maggior parte delle modifiche riguardava attività di refactoring, la rimozione di metodi inutilizzati e l’ottimizzazione stilistica. Tutte aree in cui l’intervento umano resta decisivo.

Una frase emblematica annotata in un commit: “l’avrei fatto più in fretta a mano, ma pazienza”.

Le altre lacune nella libreria Cloudflare generata con l’AI

In un lungo articolo di approfondimento, è Neil Madden ad evidenziare diverse lacune nel progetto nato sotto la spinta dell’AI di Claude. Madden osserva, ad esempio, che la copertura di test risulterebbe drammaticamente insufficiente: per uno strumento che implementa un provider OAuth, non testare ogni condizione è – a suo avviso – una mancanza importante.

In termini di CORS (Cross-Origin Resource Sharing), inoltre, consentire qualsiasi origine e metodo con intestazioni estremamente permissive riduce drasticamente l’efficacia della stessa origin policy. Anche se l’intento pare deliberato e non sembra verificarsi alcuna abilitazione delle credenziali, per Madden rimane una scelta discutibile e potenzialmente pericolosa per un provider OAuth.

Un altro punto critico consiste nell’assenza di header di sicurezza fondamentali, come X-Content-Type-Options: nosniff o Strict-Transport-Security. Anche se si tratta di API, è noto che vulnerabilità come XSS possono colpire anche risposte JSON ben formate, specialmente in assenza di tali header.

Infine, Madden rileva ancora che alcune scelte nel codice lasciano presagire una conoscenza solo superficiale delle specifiche OAuth da parte dell’intelligenza artificiale.

Insomma, se la libreria OAuth sviluppata con Claude rappresenta un esercizio affascinante di co-programmazione tra umani e AI, secondo Madden la strada per una piena integrazione è ancora lunga e ripida.

Ti consigliamo anche

Link copiato negli appunti